为什么在javascript中自动舍入的数字大于15位? [英] Why is a number having greater than 15 digits auto rounded in javascript?

查看:136
本文介绍了为什么在javascript中自动舍入的数字大于15位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的javascript号有问题。我的问题是我在HTML中有一个货币字段,当我使用javascript计算另一个字段时;然后,如果此输入字段的位数> 15,则自动舍入。
你可以在firebug中尝试这个。例如:

I have a problem with javascript number. My problem is that I have a currency field in HTML and when I use javascript to calculate with another field; then if this input field has the number of digits > 15 then this is auto rounded. You can try this in firebug. E.g:

(9999999999999999);
10000000000000000 

我该如何解决这个问题?

How do I fix this?

推荐答案

以下链接可以帮助您

在Javascript中错误地舍入大数字

此外,
此库将帮助找到解决方法 http://www.leemon.com/crypto/BigInt.html

问候,
Cyril

Regards, Cyril

这篇关于为什么在javascript中自动舍入的数字大于15位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆