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.
我安装了 jQuery numberformatter-plugin,但没有让它正常工作。我在网上找不到正确的命令。
我想格式化一个文本字段的值,其中包含一个带两个小数位的数字(如 0.16),以显示 4 个小数位(0.1600)。
您不需要任何插件:
var value = value.toFixed(4); // Cuts number to 4 decimal places (doesn't do rounding)