into this: 1.945
or even this: 1.946
Is there a function or some mathematical process to do that in a script?
Float Function RoundFloatToXDecimalPlaces(Float MyFloat, Int DecPlaces) Int Multiplier = Math.Pow(10, DecPlaces) MyFloat *= Multiplier Int Floored = Math.Floor(MyFloat) if (MyFloat - Floored >= 0.5) Return ((Floored + 1) / Multiplier) as Float else Return (Floored / Multiplier) as Float endifEndEvent
;Truncate to 3 decimalsmyFloat -= myFloat % 0.001;Round to 3 decimalsmyFloat += 0.0005myFloat -= myFloat % 0.001