The Format function formats a numeric value.
result = Format( number [, [ before ] [, [ after ] [, [ expp ] [, [ expt ] ] ] ] ) |
If 0 is specified for the expp argument, the number will be formatted in simple form, with added zeroes as necessary.
Examples:
say Format( 7, 3 ) -- shows: ' 7' say Format( 7.11, 3, 1 ) -- shows: ' 7.1' say Format( 7.15, 3, 1 ) -- shows: ' 7.2' say Format( ' - 7.11' ) -- shows: '-7.11' say Format( 12345.73, , , 2, 2 ) -- shows: '1.234573E+04' say Format( 12345.73, , , 3, 6 ) -- shows: '12345.73' say Format( 1.234573, , 3, , 0 ) -- shows: '1.235' say Format( 123.45, , 3, 2, 0 ) -- shows: '1.235E+02' |