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

Method Decimal

ext/formatting_v2.go:468–475  ·  view source on GitHub ↗

Decimal implements formatStringInterpolatorV2.Decimal.

(arg ref.Val)

Source from the content-addressed store, hash-verified

466
467// Decimal implements formatStringInterpolatorV2.Decimal.
468func (c *stringFormatCheckerV2) Decimal(arg ref.Val) (string, error) {
469 id := c.args[c.currArgIndex].ID()
470 valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.DoubleType)
471 if !valid {
472 return "", decimalFormatErrorV2(id, c.typeOf(id).TypeName())
473 }
474 return "", nil
475}
476
477// Fixed implements formatStringInterpolatorV2.Fixed.
478func (c *stringFormatCheckerV2) Fixed(precision int) func(ref.Val) (string, error) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected