Computer Science Canada

How to show only 2 decimals?

Author:  Luffy123 [ Wed May 23, 2012 10:16 pm ]
Post subject:  How to show only 2 decimals?

Say I have a number

12.99728313

How do I make it show only 12.99

or

12.997

or just 12.9?

Author:  Dreadnought [ Wed May 23, 2012 10:42 pm ]
Post subject:  Re: How to show only 2 decimals?

Read the documentation for put. Specifically, look at the use of : to format real numbers.

If you wish to convert the number to a string, you can read up about frealstr and erealstr


: