Anyone know what's going on here? I have a property on a model that is bindable:
-
[Bindable]
-
public var currentAmount:Number = 0;
I have a command that increments that value, by some fractional amount:
-
[Bindable]
-
model.currentAmount += 1.25;
What's happening is I am winding up with values like 1.25000000000000000001. Even wierder is that the last digit increments with how many times the variable is incremented, so so if I add another .50 to the previous value, I wind up with 1.75000000000000000002.
Currently I'm using a setter and fixing the problem by using toFixed(2), but that seems very retarded:
-
_currentAmount = newValue;
-
var s:String = _currentAmount.toFixed(2);
-
_currentAmount = Number(s);
I'm sure if this was a bug it would be pretty well known by now, but I can't seem to find anything on google, so I'm guessing I'm doing something wrong. Anyone have an idea?
i saw that before, check this link which registers a bug to flash player version 10 (if it's on 10 it might be also on 9),
bugs.adobe.com
and also here