.NET Framework Developer Center > .NET Development Forums > .NET Base Class Library > How to format 1.054322E+00 into nearest float value with 2 decimal points using c#
Ask a questionAsk a question
 

AnswerHow to format 1.054322E+00 into nearest float value with 2 decimal points using c#

  • Thursday, November 05, 2009 7:59 PMManasMSDN Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    please help me ,

    How to  format  1.054322E+00   into nearest  float value with 2 decimal points using c#


    Hi ,

    please help me ,

                   float x = (6.628142E-41F);
                    float y= (5.423025E-41F);
                    float xy = 74/(x + y); //gives me   Infinity

    how can i display  6.62E-41F  instead of
    6.628142E-41F?

    how to get exact float value ?
    • Edited byManasMSDN Wednesday, November 11, 2009 12:13 AMdescription
    • Edited byManasMSDN Thursday, November 05, 2009 9:20 PMdescription
    •  

Answers

All Replies