printing out float values to a few decimal points
Hello!
Does anyone know of a way to export floating point values to a set decimal place? In my case, around 3 decimal places would be fine, so 0.0001 would become 0, 1.5549 becomes 1.555 etc.
It's for an animation exporter that works by move commands (ie Move(body, x_axis, 40) and so on), but when I format my test animation to a script file I very often see things like -3.90266e-007, which is pretty much zero but not exactly intuitively so.
Comments
A method of stamping custom
A method of stamping custom business cards printing, that graphic is thoroughly introduced through the primary actinic activity of light-weight with out pursuing improvement by means of chemical substances.
formattedPrint
The function
formattedPrint
is good for such tasks ;)my recent MAXScripts RSS (archive here)
Nevermind, made a function
Nevermind, made a function for it.
function roundFloat val dp --rounds a float to a set number of decimal places
(
a = val * (10^dp)
b = a as integer
a = b as float / (10^dp)
return a
)