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

Method Decimal

ext/formatting.go:527–534  ·  view source on GitHub ↗

Decimal implements formatStringInterpolator.Decimal.

(arg ref.Val, locale string)

Source from the content-addressed store, hash-verified

525
526// Decimal implements formatStringInterpolator.Decimal.
527func (c *stringFormatChecker) Decimal(arg ref.Val, locale string) (string, error) {
528 id := c.args[c.currArgIndex].ID()
529 valid := c.verifyTypeOneOf(id, types.IntType, types.UintType)
530 if !valid {
531 return "", decimalFormatError(id, c.typeOf(id).TypeName())
532 }
533 return "", nil
534}
535
536// Fixed implements formatStringInterpolator.Fixed.
537func (c *stringFormatChecker) Fixed(precision *int) func(ref.Val, string) (string, error) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected