开发者

Javascript numerical calculation concerns

I am implementing a cu开发者_StackOverflowrrency converter with javascript, e.g., convert USD to SGD. Do you know any article or trick about concerns like precision issue that I need to tackle?

Thanks.


Accuracy seems to be the biggest issue here. There are many good sources to be found around the internet. This short article by William Bontragerone handles the accuracy problem sufficently.


Just retain precision until you have to display the results on the page. And always prepare for the possibility that the user could put anything as input, including telephone numbers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜