Fixed # of decimal places after the point

Blitz3D Forums/Blitz3D Beginners Area/Fixed # of decimal places after the point

Function f2s$(f#, decimals%)
	Local i = Floor(f)
	f = f - i
	Local e = (10^decimals)
	Local i2 = e*10+Int(f*e)
	Return i+"."+Right(i2, decimals)
End Function

Print f2s(12.0503, 1)
You're welcome, I'm really bored today :)