Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DoubleToString and E notation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    DoubleToString and E notation

    Hello I need to convert a double to string.

    No trouble with normal number

    double x = 1,23;
    string s = x.ToString()

    Result = "1,23"


    But with very small numbers..

    double x = 0.000001;
    string s = x.ToString()

    Result = "1E-06"


    Any solution?

    #2
    I would suggest to review the various String format options C# offers - http://www.ninjatrader.com/support/f...ead.php?t=3823

    You could for example force fixed point formatting and your # of decimals...

    Comment


      #3
      I've resolved with the function in this post: http://www.ninjatrader.com/support/f...2&postcount=10

      Thanks for your reply.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      152 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      87 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      131 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      127 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      106 views
      0 likes
      Last Post CarlTrading  
      Working...
      X