MCPcopy Create free account
hub / github.com/expr-lang/expr / Round

Function Round

builtin/lib.go:142–152  ·  view source on GitHub ↗
(x any)

Source from the content-addressed store, hash-verified

140}
141
142func Round(x any) any {
143 switch x := x.(type) {
144 case float32:
145 return math.Round(float64(x))
146 case float64:
147 return math.Round(x)
148 case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:
149 return Float(x)
150 }
151 panic(fmt.Sprintf("invalid argument for round (type %T)", x))
152}
153
154func Int(x any) any {
155 switch x := x.(type) {

Callers

nothing calls this directly

Calls 2

FloatFunction · 0.85
SprintfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…