Currency rounding inconsistencies in Dojo.currency -


im working dojo.currency format. there seems inconstancies on how rounds, im trying find if im doing wrong:

dojo.currency.format("66.315",{currency:"usd"}) "$66.31" dojo.currency.format("669.315",{currency:"usd"}) "$669.32" 

in above example both prices rounded 32 cents, reason end 2 different amounts.

looks dojo.currency using dojo.number.round under covers, , dojo.number.round uses javascript tofixed. known have floating point problem.

using math.round(number*math.pow(10,places))/math.pow(10,places) instead


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -