C# decimal format


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public static void Main() {
  2. double num = 64354.2345;
  3.  
  4. Console.WriteLine("Default format: " + num);
  5.  
  6. Console.WriteLine("Use scientific notation: " +
  7. "{0:#.###e+00}", num);
  8.  
  9. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.