Format
→ stringFormats a value according to a .NET format string — useful for number formatting, padding, and specialized string output.
Available in:
Email
CloudPage
Automation
Triggered Send
Syntax
Platform.Function.Format(value, format)
2+ arguments
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
value |
string | Yes | Value to format |
format |
string | Yes | .NET format string |
Examples
// Currency format
var price = Platform.Function.Format(1234.5, "C2");
Write(price); // "$1,234.50"
// Number with thousands separator
var num = Platform.Function.Format(9876543, "N0");
Write(num); // "9,876,543"
// Percentage
var pct = Platform.Function.Format(0.852, "P1");
Write(pct); // "85.2%"
// Zero-padded number
var padded = Platform.Function.Format(7, "D4");
Write(padded); // "0007"