1

I understand I can format a number into millions as this,

double value = 1234567890;
Console.WriteLine(value.ToString("#,##0,,", CultureInfo.InvariantCulture));
Console.WriteLine(String.Format(CultureInfo.InvariantCulture, 
                            "{0:#,##0,,}", value));
// Displays 1,235

Is there a way to format number into ten thousands decimals and 100million decimals without changing the value of the original number by division and so on, for example

100000 will be formatted to 10 in term of ten thousands

1230000000 will be formatted to 12.3 in term of 100 million

ekad
  • 14,436
  • 26
  • 44
  • 46
tesla1060
  • 2,621
  • 6
  • 31
  • 43
  • how will you differentiate b/w 10 and 12.3 ?? – A.T. Feb 06 '14 at 04:40
  • I have never come across a way of doing this. You could use a custom formatter, then you can format it any way you like. http://msdn.microsoft.com/en-us/library/bb762932%28v=vs.110%29.aspx – Amleth Feb 06 '14 at 04:42
  • @Aaron i was being unclear before, updated the final part of my question. – tesla1060 Feb 06 '14 at 05:13

0 Answers0