简体   繁体   English

我们如何将Javascript中的科学计数法转换为数字

[英]How do we convert scientific notation to number in Javascript

So if I do 712569312664357328695151392 + 8100824045303269669937 I want the result to be:所以如果我做712569312664357328695151392 + 8100824045303269669937我希望结果是:

712577413488402631964821329

But instead I have但是我有

7.125774134884027e+26 7.125774134884027e+26

let a = 712569312664357328695151392;
let b = 8100824045303269669937;

(BigInt(a) + BigInt(b)).toString() will give you your expected result. (BigInt(a) + BigInt(b)).toString()会给你你预期的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将包含科学记数法的字符串转换为正确的 Javascript 数字格式 - How to convert a String containing Scientific Notation to correct Javascript number format 如何在javascript中将大的负科学记数字转换为十进制记号字符串? - How to convert big negative scientific notation number into decimal notation string in javascript? 如何用科学计数法格式化数字以在Javascript中显示更少的数字? - How do I format a number in scientific notation to show less digits in Javascript? 如何将 JavaScript BigInt 值转换为科学记数法? - How can I convert a JavaScript BigInt value to Scientific Notation? javascript 转换科学计数法,如何确定 10 次方后的数字 - javascript converting scientific notation, how to determine the number after power of 10 如果不用科学记数法显示,JavaScript编号有多小? - How small can a JavaScript number be without displaying in scientific notation? Javascript - 科学记数法受限制的最大数量是多少? - Javascript - What is the maximum number in scientific notation restricted by? JavaScript 将科学记数法中的不安全整数转换为字符串 - JavaScript convert not safe integer in scientific notation to string 科学符号手机号码-Excel Javascript - Scientific notation mobile number - Excel Javascript 如何将数字转换为科学记数法? - How can I convert numbers into scientific notation?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM