areskar
15 years agoVisitor
Format a float value with a specified number of decimals?
Hi, is there any possibility to round of a float/double value with a given amount of decimals. For example turn the number 1.27456 into 1.3?
I haven't found anything in the documentation (2.4 SDK release) to support this. Tried a workaround with string conversion, but this turns out to be hard since floats and doubles don't have the tostr() interface method.
Also, I would like to write this formatted float value as text on a roImageCanvas. But this does not seem to work either because of the mentioned tostr() limitation since the text attribute is a String value.
Is this not possible, or is there a specific way of doing it?
Any help on this topic is appreciated!
I haven't found anything in the documentation (2.4 SDK release) to support this. Tried a workaround with string conversion, but this turns out to be hard since floats and doubles don't have the tostr() interface method.
Also, I would like to write this formatted float value as text on a roImageCanvas. But this does not seem to work either because of the mentioned tostr() limitation since the text attribute is a String value.
Is this not possible, or is there a specific way of doing it?
Any help on this topic is appreciated!