locked
Rounding to Float Number RRS feed

  • Question

  • Hi;

    my questions about round number

    for example..  7,26   =  7,3  or   8,12 = 8,1

    but not supported Math Class...

    can i do ?

     

    Friday, July 28, 2006 2:01 PM

Answers

  • Hope this helps.

    float tmp = 7.26f;

    float help = (float) Math.Round(tmp, 1);

    Debug.WriteLine(tmp + " => " + help);

    Friday, July 28, 2006 2:37 PM

All replies

  • Hope this helps.

    float tmp = 7.26f;

    float help = (float) Math.Round(tmp, 1);

    Debug.WriteLine(tmp + " => " + help);

    Friday, July 28, 2006 2:37 PM
  • thank you...
    Friday, July 28, 2006 10:18 PM
  • Thank you so very much!
    Tuesday, February 4, 2014 3:14 AM