Make a huge number small using eular in math - c#

Hemanth B 886 Reputation points
2021-08-31T14:00:27.937+00:00

Hi, I have a number that is 100000000000. Now I want it to show in a scientific notation like 1.0000E+11. How do I do that in C#?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,648 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AgaveJoe 27,696 Reputation points
    2021-08-31T14:09:30.137+00:00

    Please see standard numeric formatting in C#.

    long number = 100000000000;  
    string numberFormat = number.ToString("E");  
    Console.WriteLine(numberFormat);  
    

    Results

    1.000000E+011  
    
    2 people found this answer helpful.
    0 comments No comments