MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Fixed

Method Fixed

ext/formatting_v2.go:478–487  ·  view source on GitHub ↗

Fixed implements formatStringInterpolatorV2.Fixed.

(precision int)

Source from the content-addressed store, hash-verified

476
477// Fixed implements formatStringInterpolatorV2.Fixed.
478func (c *stringFormatCheckerV2) Fixed(precision int) func(ref.Val) (string, error) {
479 return func(arg ref.Val) (string, error) {
480 id := c.args[c.currArgIndex].ID()
481 valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.DoubleType)
482 if !valid {
483 return "", fixedPointFormatErrorV2(id, c.typeOf(id).TypeName())
484 }
485 return "", nil
486 }
487}
488
489// Scientific implements formatStringInterpolatorV2.Scientific.
490func (c *stringFormatCheckerV2) Scientific(precision int) func(ref.Val) (string, error) {

Callers

nothing calls this directly

Calls 5

verifyTypeOneOfMethod · 0.95
typeOfMethod · 0.95
fixedPointFormatErrorV2Function · 0.85
IDMethod · 0.65
TypeNameMethod · 0.65

Tested by

no test coverage detected