Format Number
Turns a scalar into a formatted string — decimals, zero-padding, thousands separators, prefix/suffix. The missing link for counters, timers, and readouts.
Category: Text Menu path: Text > Format Number
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
value_in | scalar | input | The number to format (overrides the value param) |
out | string | output | Formatted string — feed into Text.content_in or MergeText |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
value | scalar | 0 | Fallback value when value_in is disconnected. Keyframeable |
decimals | scalar (int) | 0 | Fixed decimal places (0–12) |
padWidth | scalar (int) | 0 | Zero-pad the integer part to at least this many digits (0 = off). padWidth 4 → 0042 |
separator | enum | None | Thousands grouping: None, Comma (1,234,567), Space (1 234 567), Period (1.234.567) |
prefix | string | (empty) | Prepended verbatim (e.g. $) |
suffix | string | (empty) | Appended verbatim (e.g. %, pts) |
How It Works
The input scalar is formatted with a fixed number of decimals (half-to-even rounding), the integer part is zero-padded and grouped, and prefix/suffix wrap the result. A negative sign goes before the prefix (-$5.00); values that round to zero never print -0. Non-finite inputs format as 0.
Usage Examples
Frame counter
Time (frame) → FormatNumber (padWidth: 4) → Text.content_in. Renders 0000, 0001, 0042… as the comp plays.
Animated percentage readout
Keyframe value 0 → 100 (or drive value_in from any scalar), set decimals: 0, suffix: %. Classic loading/stat number.
Price tag
Math chain → FormatNumber (decimals: 2, separator: Comma, prefix: $) → $1,234.50.
Countdown clock (seconds)
Time (seconds) → Math (Subtract from total) → FormatNumber (decimals: 1, suffix: s).
Tips
- Compose with MergeText to embed the number inside a longer sentence (
"Score: " + value + " pts"as three inputs). - The string output is Hold-interpolated by nature — the text changes exactly when the number does, which is what you want for counters.
- Decimals use banker's rounding (half-to-even): 2.5 → 2, 3.5 → 4 — standard display-formatting behavior.