Description

Text converts the floating-point number x to a string according to the given format and precision prec. The format is one of:

'e'	-d.dddde±dd, decimal exponent, at least two (possibly 0) exponent digits
'E'	-d.ddddE±dd, decimal exponent, at least two (possibly 0) exponent digits
'f'	-ddddd.dddd, no exponent
'g'	like 'e' for large exponents, like 'f' otherwise
'G'	like 'E' for large exponents, like 'f' otherwise
'b'	-ddddddp±dd, binary exponent
'p'	-0x.dddp±dd, binary exponent, hexadecimal mantissa

For the binary exponent formats, the mantissa is printed in normalized form:

'b'	decimal integer mantissa using x.Prec() bits, or -0
'p'	hexadecimal fraction with 0.5 <= 0.mantissa < 1.0, or -0

If format is a different character, Text returns a "%" followed by the unrecognized format character.

The precision prec controls the number of digits (excluding the exponent) printed by the 'e', 'E', 'f', 'g', and 'G' formats. For 'e', 'E', and 'f' it is the number of digits after the decimal point. For 'g' and 'G' it is the total number of digits. A negative precision selects the smallest number of decimal digits necessary to identify the value x uniquely using x.Prec() mantissa bits. The prec value is ignored for the 'b' or 'p' format.