isn’t there a function that reduces a floating point number to x didgets after the decimal i thought i saw it somewhere and have been unable to find it again
you mean rounding a float? or shiftleft/shiftright?
Rounding…
print “this is a float %.6f” % 22 / 7.0
This rounds to 6 dec places. FCC standards only require a CPU’s floating point operations to be accurate to 6 places so this is commonly used for storing floats as strings, also dosent take too much space.
Most of these very simple functions can be found in the section Built-in functions. Look for the function “round”:
http://www.python.org/doc/2.3.5/lib/built-in-funcs.html
try :
print round(22.0/7.0,5)
(I use the “%.nf” % float since years in povanim and in a few others scripts well know now) .
ok thanks I didn’t remember where to find it or exactly how to call it