Code: Select all
_this.setformat(@all) f.2my 5.225 rounds to 5.22 rather than 5.23.
Whether a 5 rounds up or down seems to depend on the value. For example, 10.225 rounds to 10.23. If I change the numbers slightly to 5.325 and 10.325, it goes the other way: I get 5.33 and 10.32...
As far as I can tell, this only happens with 5's in the third decimal place. If have 5.25 and set format to f.1, I get 5.3. If I have 5.2225 and set format to f.3 I get 5.223.
Bug? Or are the rules of rounding way more complex than I think?
