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

Method Scientific

ext/formatting.go:550–559  ·  view source on GitHub ↗

Scientific implements formatStringInterpolator.Scientific.

(precision *int)

Source from the content-addressed store, hash-verified

548
549// Scientific implements formatStringInterpolator.Scientific.
550func (c *stringFormatChecker) Scientific(precision *int) func(ref.Val, string) (string, error) {
551 return func(arg ref.Val, locale string) (string, error) {
552 id := c.args[c.currArgIndex].ID()
553 valid := c.verifyTypeOneOf(id, types.DoubleType, types.StringType)
554 if !valid {
555 return "", scientificFormatError(id, c.typeOf(id).TypeName())
556 }
557 return "", nil
558 }
559}
560
561// Binary implements formatStringInterpolator.Binary.
562func (c *stringFormatChecker) Binary(arg ref.Val, locale string) (string, error) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected