none
Exponential format RRS feed

  • Question

  • Hi,

    How can i show large number in exponential format like this: 1.7E-07 ??

    I know how to format precision before E, but how can i format precisio after E ? On MSDN default format is with tree digits (E-007).

    I know specify to show only two digis (E-07)...

    Any ideas how to do this?

    Thanks. Best regards.

    dEVIANT

    Monday, June 18, 2012 8:30 AM

Answers

  • I hope you can find this article a helpful one

    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    • Marked as answer by dEVIANT22 Monday, June 18, 2012 9:07 AM
    Monday, June 18, 2012 9:02 AM

All replies

  • If you want plain output use "E" or "e".

    double exp = 43895.04390;
    Console.WriteLine(exp.ToString("e"));//Output 4.389504e+004

    or else if you want to specificy the digit placing

    double exp = 43895.04390;
    Console.WriteLine(exp.ToString("E9"));//Output 4.389504390E+004


    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    Monday, June 18, 2012 8:37 AM
  • In yout case i don't want output
    4.389504e+004
    but
    4.389504e+04
    Thats the difference. Is it possible ?
    Monday, June 18, 2012 8:47 AM
  • I hope you can find this article a helpful one

    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    • Marked as answer by dEVIANT22 Monday, June 18, 2012 9:07 AM
    Monday, June 18, 2012 9:02 AM