We Recommend

Accelerated C# 2008 Accelerated C# 2008
This book is both a rapid tutorial and a permanent reference. You’ll quickly master C# syntax while learning how the CLR simplifies many programming tasks. You’ll also learn best practices that ensure your code will be efficient, reusable, and robust. Why spend months or years discovering the best ways to design and code C# when this book will show you how to do things the right way, right from the start?


Posted By

beresovskiy on 06/05/09


Tagged

format output strings double


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

umang_nine


C# decimal format


Published in: C# 


  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 

You need to login to post a comment.