Decimal numbers

  • Thread starter Thread starter Alberto
  • Start date Start date
A

Alberto

How can I do to see a float numer in screen with only 2 decimals?

Thank you.
 
Alberto said:
How can I do to see a float numer in screen
with only 2 decimals?

float pi = 3.14159;
string piTo2 = pi.ToString("F2"); // "3.14"

P.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top