Thanks, I missed the whole “failable functions” part.
Round() only rounds to a whole number, what I need is to round to 3 decimal places.
Can you please give me an example?
Value = 6.456123456
and my desired output is 6.456 as float or as string (“6.456”).
Below is my attempt, when I divide the integer with 1000, and I get a rational type, and there is no way to convert a rational to either float or string.
var myFloatNumber : float = 6.456123456 * 1000.0
var myIntNumber : int = 0
var myFinalNumber : string = ""
if (Value := Round[myFloatNumber]):
set myIntNumber = Value
if (Value : rational = myIntNumber / 1000):
set myFinalNumber = ToString(Value)
Print(myFinalNumber)