Transform Reference
Numeric Verbs
Arithmetic operations, rounding, formatting, and mathematical functions.
| Verb | Syntax | Description | Try It |
|---|---|---|---|
| formatNumber | %formatNumber @path decimals | Format with decimal places | Try |
| formatInteger | %formatInteger @path | Format as integer | Try |
| formatCurrency | %formatCurrency @path | Format as currency (2 decimals) | Try |
| formatPercent | %formatPercent @path decimals | Format as percentage | Try |
| abs | %abs @path | Absolute value | Try |
| round | %round @path decimals | Round to decimal places | Try |
| floor | %floor @path | Round down | Try |
| ceil | %ceil @path | Round up | Try |
| multiply | %multiply @a @b | Multiply two values | Try |
| divide | %divide @a @b | Divide a by b | Try |
| add | %add @a @b | Add two values | Try |
| subtract | %subtract @a @b | Subtract b from a | Try |
| mod | %mod @a @b | Modulo (remainder) | Try |
| negate | %negate @path | Flip sign | Try |
| convertUnit | %convertUnit @value "from" "to" | Convert between compatible units (mass, length, temp, volume, speed, area, data, time) | Try |
Reference
Conversion Units (convertUnit) — Supported Families
Units must belong to the same family. Cross-family conversions (e.g. "kg" to "m") return null. Results are rounded to 6 decimal places.
| Family | Units | Base Unit |
|---|---|---|
| Mass | g, kg, mg, lb, oz, ton, tonne | g |
| Length | m, km, cm, mm, mi, yd, ft, in | m |
| Volume | l, ml, gal, qt, pt, cup, floz | l |
| Speed | m/s, km/h, mph, knot, ft/s | m/s |
| Area | m2, km2, cm2, ha, acre, ft2, in2, mi2 | m2 |
| Data | B, KB, MB, GB, TB | B |
| Time | s, ms, min, h, d, wk | s |
| Temperature | C, F, K | formula-based |
Note: Temperature uses formula conversion (not ratio-based). Data units use binary prefixes (1 KB = 1024 B).
Examples
Numeric verb examples
; Formatting
premium = %formatNumber @premium ##2 ; 1234.5 -> "1234.50"
year = %formatInteger @vehicle.year ; 2024.0 -> "2024"
; Arithmetic
surcharge = %multiply @base_premium #1.15 ; 100 -> 115 (15%)
monthly = %divide @annual_premium ##12 ; 1200 -> 100
total = %add @base @surcharges ; 500 + 75 -> 575
; Unit conversion
weight_lb = %convertUnit @weight_kg "kg" "lb" ; 100 -> 220.462
temp_f = %convertUnit @temp_c "C" "F" ; 100 -> 212