MCPcopy Create free account
hub / github.com/tdewolff/canvas / String

Method String

util.go:161–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

159type dec float64
160
161func (f dec) String() string {
162 s := fmt.Sprintf("%.*f", Precision, f)
163 s = string(minify.Decimal([]byte(s), Precision))
164 if dec(math.MaxInt32) < f || f < dec(math.MinInt32) {
165 if i := strings.IndexByte(s, '.'); i == -1 {
166 s += ".0"
167 }
168 }
169 return s
170}
171
172// CSSColor is a string formatter to convert a color.RGBA to a CSS color (hexadecimal or using rgba()).
173type CSSColor color.RGBA

Callers

nothing calls this directly

Calls 1

decTypeAlias · 0.70

Tested by

no test coverage detected