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

Method Fixed

ext/formatting.go:537–547  ·  view source on GitHub ↗

Fixed implements formatStringInterpolator.Fixed.

(precision *int)

Source from the content-addressed store, hash-verified

535
536// Fixed implements formatStringInterpolator.Fixed.
537func (c *stringFormatChecker) Fixed(precision *int) func(ref.Val, string) (string, error) {
538 return func(arg ref.Val, locale string) (string, error) {
539 id := c.args[c.currArgIndex].ID()
540 // we allow StringType since "NaN", "Infinity", and "-Infinity" are also valid values
541 valid := c.verifyTypeOneOf(id, types.DoubleType, types.StringType)
542 if !valid {
543 return "", fixedPointFormatError(id, c.typeOf(id).TypeName())
544 }
545 return "", nil
546 }
547}
548
549// Scientific implements formatStringInterpolator.Scientific.
550func (c *stringFormatChecker) Scientific(precision *int) func(ref.Val, string) (string, error) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected