Formatting Large Numbers with .NET

前端 未结 5 1828
梦如初夏
梦如初夏 2020-12-16 03:45

I have a requirement to format large numbers like 4,316,000 as \"4.3m\".

How can I do this in C#?

5条回答
  •  庸人自扰
    2020-12-16 04:15

    divide the number by 1000000.0, then append an "m".

    remember to round the number to 1 decimal place.

提交回复
热议问题