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

Method Scientific

ext/formatting_v2.go:490–499  ·  view source on GitHub ↗

Scientific implements formatStringInterpolatorV2.Scientific.

(precision int)

Source from the content-addressed store, hash-verified

488
489// Scientific implements formatStringInterpolatorV2.Scientific.
490func (c *stringFormatCheckerV2) Scientific(precision int) func(ref.Val) (string, error) {
491 return func(arg ref.Val) (string, error) {
492 id := c.args[c.currArgIndex].ID()
493 valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.DoubleType)
494 if !valid {
495 return "", scientificFormatErrorV2(id, c.typeOf(id).TypeName())
496 }
497 return "", nil
498 }
499}
500
501// Binary implements formatStringInterpolatorV2.Binary.
502func (c *stringFormatCheckerV2) Binary(arg ref.Val) (string, error) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected