Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
无论如何要保存浮点数并同时保留其小数位吗?例如
1.50 将保存为 1.50 而不是 1.5。
我已经尝试过诸如 toFixed 之类的解决方案,但他们返回给我一个 typeof 字符串的变量。
我认为这是不可能的,如果你想保留那些零,你必须把它变成一个字符串。