Previous Up Next

25.5.6  Converting real numbers to strings

The format command converts a real number to a string.

The formatting string can be one of the following:

Examples

format(sqrt(2)*10^10,"f13")
     
“14142135623.7308959960938”           
format(sqrt(2)*10^10,"s13")
     
“14142135623.73”           
format(sqrt(2)*10^10,"e13")
     
“1.4142135623731e+10”           

Previous Up Next