MCPcopy Create free account
hub / github.com/cockroachdb/apd / Text

Method Text

format.go:28–31  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
28func (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.

Callers 1

StringMethod · 0.95

Calls 1

AppendMethod · 0.95

Tested by

no test coverage detected