Calculate large decimals (more than 15 digits) in Javascript

老子叫甜甜 提交于 2019-12-02 09:41:22
nbering

I already answered this in the comment, but here's a demonstration. BigNumber will accept a number in string format for input.

console.log(new BigNumber(0.1).plus("198.43092534959501"));
<script src="https://cdnjs.cloudflare.com/ajax/libs/bignumber.js/6.0.0/bignumber.min.js"></script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!