I have a requirement to format large numbers like 4,316,000 as \"4.3m\".
How can I do this in C#?
If you're only running on Windows you could use a p-invoke declaration in C# or VB.NET to call the Win32 functions StrFormatByteSizeW or StrFormatByteSize64. If your application/site is guaranteed to be running on at least Vista SP1 or Server 2008 there's also StrFormatByteSizeEx with a few more options.
Sample from the MSDN docs:
Numeric value Text string
532 532 bytes
1340 1.30KB
23506 22.9KB
2400016 2.29MB
2400000000 2.23GB
These APIs also handle localization correctly for non-English users.