Skip to content

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

PortTypeDirectionDescription
value_inscalarinputThe number to format (overrides the value param)
outstringoutputFormatted string — feed into Text.content_in or MergeText

Parameters

ParamTypeDefaultDescription
valuescalar0Fallback value when value_in is disconnected. Keyframeable
decimalsscalar (int)0Fixed decimal places (0–12)
padWidthscalar (int)0Zero-pad the integer part to at least this many digits (0 = off). padWidth 40042
separatorenumNoneThousands grouping: None, Comma (1,234,567), Space (1 234 567), Period (1.234.567)
prefixstring(empty)Prepended verbatim (e.g. $)
suffixstring(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.
  • Text — renders the string (content_in)
  • String — raw string source
  • MergeText — concatenate strings
  • Time — frame/seconds source for counters
  • Math — shape the number before formatting