Skip to manual
gluon

Expression functions

gluon.money(amount, currency)

Builds a money value from an amount and a currency code.

Model author or developer

Example

CEL
gluon.money(125, "EUR")

This returns {"amount": 125, "currency": "EUR"}.

Types

The type checker knows it as gluon.money(dyn, string) -> dyn. Call it in any GOL field that takes CEL: a Function, a derived property, a constraint or a policy condition.

Limits

It only builds the map. It converts no currency, rounds no amount and accepts any string as the currency code.

Guard optional inputs with has(). In a policy, an evaluation error denies. An expression that does not parse, runs past 2,000 characters or nests too deeply is GLN-E201, and one whose result has the wrong type is GLN-E202.

See Function, Test and the language guide.

gluon.money(amount, currency) evaluated by Gluon's CEL runtime.
gluon.money(amount, currency) evaluated by Gluon's CEL runtime.