MCPcopy Create free account
hub / github.com/cloudspannerecosystem/spanner-cli / nullNumericToString

Function nullNumericToString

decoder.go:319–327  ·  view source on GitHub ↗
(v spanner.NullNumeric)

Source from the content-addressed store, hash-verified

317}
318
319func nullNumericToString(v spanner.NullNumeric) string {
320 if v.Valid {
321 s := v.Numeric.FloatString(spanner.NumericScaleDigits)
322 s = strings.TrimRight(s, "0") // trim trailing 0: 123.000000000 => 123.
323 return strings.TrimSuffix(s, ".") // trim unused dot: 123. => 123
324 } else {
325 return "NULL"
326 }
327}
328
329func nullStringToString(v spanner.NullString) string {
330 if v.Valid {

Callers 1

DecodeColumnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected