KScript docs
EN

currency fields and methods

A field is a plain fact about the value, read with a dot and no brackets: $value.name. A method takes arguments or does work, and is called with ->: $value->name(arguments), or with the value piped in: $value |> name(arguments).

Fields

FieldTypeDescription
.digitsnumberHow many decimal places amounts have: 2 for GBP, 0 for JPY.
.namestringThe currency's name in English: British Pound.
.symbolstringIts symbol: £.

From KScript.Core

#currency->format(amount: number) → string

An amount written in this currency: £1,234.50.
ParameterTakes
amount requirednumber
Example
<let name="x" type="currency" value="'jpy'" />
<echo>{ $x->format(1234.5) }</echo>
$x: currency = 'jpy'
echo $x->format(1234.5)

Methods from any

Methods from string