【发布时间】:2012-02-18 23:27:39
【问题描述】:
可能重复:
Is there a way round numbers into a friendly format? (e.g. $1.1k)
How to format numbers similar to Stack Overflow reputation format
我在 JS 中有很长的数字,我想让它们以更短、更容易理解的方式出现..
所以:
1,000,000 = 1M
1,200,000 = 1.2M
1,450 = 1.45K and so on...
有什么想法可以在 JS 或 JQuery 中做到这一点吗?
【问题讨论】:
标签: javascript jquery