I know about floating-point inaccuracy, but...

BlitzMax Forums/BlitzMax Programming/I know about floating-point inaccuracy, but...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Notify String(0.01)

--EDIT--

I guess this isn't a real bug. Here's a way to deal with it:

Function FloatToString$(value#,places=2)
intpart$=Int(Floor(value))+"."
decpart$=Int(Round(value*(10^(places)) Mod (10^(places))))
For n=decpart.length To places-1
decpart="0"+decpart
Next
Return intpart+decpart
Function Round(val#)
Local dec#
dec#=val-Floor(val)
If dec<0.5 Return Floor(val) Else Return Ceil(val)
EndFunction
EndFunction