MCPcopy
hub / github.com/dgraph-io/dgraph / FloatArrayAsString

Function FloatArrayAsString

types/value.go:49–61  ·  view source on GitHub ↗
(v []float32)

Source from the content-addressed store, hash-verified

47}
48
49func FloatArrayAsString(v []float32) string {
50 var sb strings.Builder
51
52 sb.WriteRune('[')
53 for i := range v {
54 sb.WriteString(strconv.FormatFloat(float64(v[i]), 'f', -1, 32))
55 if i != len(v)-1 {
56 sb.WriteRune(',')
57 }
58 }
59 sb.WriteRune(']')
60 return sb.String()
61}
62
63// TypeForValue tries to determine the most likely type based on a value. We only want to use this
64// function when there's no schema type and no suggested storage type.

Callers 2

ConvertFunction · 0.85
MarshalFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected