Text converts the floating-point number x to a string according to the given format. The format is one of: 'e' -d.dddde±dd, decimal exponent, exponent digits 'E' -d.ddddE±dd, decimal exponent, exponent digits 'f' -ddddd.dddd, no exponent 'g' like 'e' for large exponents, like 'f' otherwise 'G'
(format byte)
| 26 | // zeros (the 'g' format avoids the use of 'f' in this case). All other |
| 27 | // formats always show the exact precision of the Decimal. |
| 28 | func (d *Decimal) Text(format byte) string { |
| 29 | var buf [16]byte |
| 30 | return string(d.Append(buf[:0], format)) |
| 31 | } |
| 32 | |
| 33 | // String formats x like x.Text('G'). It matches the to-scientific-string |
| 34 | // conversion of the GDA spec. |