yamato wrote: ↑June 7th, 2021, 8:41 pm
I need to use a string as a number,
however it doesn't work, because the format of the string is such as : 1,234.5 (with a coma)
I already tried :
that works well to get rid of the coma, but the result (1234.5) oddly doesn't seems to be usable as a number, or when I use it as a number, that number is 1 (not 1234.5).
What's going wrong ?
The key is that you must use the "string" value of the measure containing the numeric value, so the Substitute is applied where the value is used. Substitute is only applied to the string value of a measure, and only at the time and place where the string value is "used".
Code: Select all
Formula=([MeasureString] + 765.5)
The important bit here is that I am using the [MeasureString] section variable to get the value. That will force the Calc measure to use the string value of the measure, and it will then convert it to a number if the result is in fact numeric. Note that if I just used Formula=MeasureString + 765.5
, that would attempt to use the number value of the measure, without any Substitute applied, and the value would be "1", which is where it will stop trying to convert it to a number, since a ,
comma is not a valid part of a numeric value. So the answer would be 766.5, which is the 1 added to the 765.5
You do not have the required permissions to view the files attached to this post.