Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

js--将数字转成字符串的问题 #1

Open
appbeijing opened this issue May 17, 2021 · 1 comment
Open

js--将数字转成字符串的问题 #1

appbeijing opened this issue May 17, 2021 · 1 comment

Comments

@appbeijing
Copy link

let a=1.123456789987654321;
需要将a转变成字符串(“1.123456789987654321”),切精度不丢失,怎么搞?

@yygmind
Copy link
Contributor

yygmind commented May 18, 2021

理论上可以把数字类型变量 a 分拆成两部分,分别转成字符串然后拼接。但是这边 let a=1.123456789987654321 执行后,其实 a 本身就已经精度丢失了,和转成字符串没关系。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants