MCPcopy
hub / github.com/shopspring/decimal / StringScaled

Method StringScaled

decimal.go:1904–1906  ·  view source on GitHub ↗

StringScaled first scales the decimal then calls .String() on it. Deprecated: buggy and unintuitive. Use StringFixed instead.

(exp int32)

Source from the content-addressed store, hash-verified

1902//
1903// Deprecated: buggy and unintuitive. Use StringFixed instead.
1904func (d Decimal) StringScaled(exp int32) string {
1905 return d.rescale(exp).String()
1906}
1907
1908func (d Decimal) string(trimTrailingZeros bool) string {
1909 if d.exp >= 0 {

Callers 2

TestDecimal_rescaleFunction · 0.80

Calls 2

rescaleMethod · 0.95
StringMethod · 0.45

Tested by 2

TestDecimal_rescaleFunction · 0.64