Skip to content

Formatting

NLT makes it easy to display numbers, dates, and text in polished, reader-friendly formats. Just add a formatting modifier after your variable and the engine handles the rest.


Currency

Format any number as a currency amount using as "currency". By default, it formats as US dollars:

Default currency (USD)
Template
{the user's Balance, as "currency"}
Output
$250.75

To use a different currency, add the currency code after currency:

Euro formatting
Template
{the user's Balance, as "currency EUR"}
Output
€250.75
Japanese Yen (no decimals)
Template
{the user's Balance, as "currency JPY"}
Output
¥1,234

Numbers are automatically formatted with thousands separators. For example, 1234.5 becomes $1,234.50.

Supported Currencies

CodeSymbolDecimalsCodeSymbolDecimals
USD$2SGDS$2
EUR2VND0
GBP£2THB฿2
JPY¥0MYRRM2
CNY¥2IDRRp0
KRW0PHP2
INR2BRLR$2
AUDA$2CHFCHF2
CADC$2
Tip

If you use a currency code that isn't in the table above, it will still work -- the code is used as a prefix. For example, as "currency XYZ" produces XYZ 250.75.


Percentage

Format numbers as percentages using as "percentage":

Whole number percentage
Template
{the user's Score, as "percentage"}
Output
85%
Ratio auto-detection (value is 0.156)
Template
{the user's Rate, as "percentage"}
Output
15.6%
Note

Ratio auto-detection: Values between -1 and 1 (like 0.156 or 0.5) are automatically treated as ratios and multiplied by 100. So a value of 0.5 becomes 50%, and 0.156 becomes 15.6%. Whole numbers like 85 are used as-is, giving you 85%.


Dates

Date Presets

NLT includes three built-in date formats:

PresetSyntaxExample Output
Short dateas "short date"15 Mar 2026
Long dateas "long date"March 15, 2026
Timeas "time"2:30 PM
Short date format
Template
{the user's Signup Date, as "short date"}
Output
15 Mar 2026
Long date format
Template
{the user's Signup Date, as "long date"}
Output
March 15, 2026
Time format
Template
{the user's Last Login, as "time"}
Output
2:30 PM

Custom Date Formats

Build your own date format using these tokens:

TokenDescriptionExample
DDDay of month (zero-padded)01, 15, 31
MMMonth number (zero-padded)01, 12
MMMShort month nameJan, Mar, Dec
MMMMFull month nameJanuary, March, December
YYYYFour-digit year2026
HHHour (24-hour, zero-padded)00, 14, 23
mmMinutes (zero-padded)00, 30, 59
AAM/PM markerAM, PM
Custom: DD MMM YYYY
Template
{the user's Date, as "DD MMM YYYY"}
Output
15 Mar 2026
Custom: DD/MM/YYYY
Template
{the user's Date, as "DD/MM/YYYY"}
Output
15/03/2026
Custom: MMMM D, YYYY
Template
{the user's Date, as "MMMM D, YYYY"}
Output
March 15, 2026
Custom: time with AM/PM
Template
{the user's Date, as "HH:mm A"}
Output
14:30 PM

Text Transforms

Change the casing of any text value:

ModifierInputOutput
uppercasehello worldHELLO WORLD
lowercaseHELLO WORLDhello world
titlecaseit's a good dayIt's A Good Day
capitalizehello worldHello world
Uppercase
Template
{the user's Name, uppercase}
Output
JANE DOE
Title case
Template
{the user's Name, titlecase}
Output
Jane Doe
Capitalize (first letter only)
Template
{the user's Name, capitalize}
Output
Jane doe
Tip

titlecase is smart about apostrophes -- it's a test becomes It's A Test, not It'S A Test. And capitalize only changes the very first character, leaving everything else as-is.


Rounding

Round numbers to a specific number of decimal places:

Round to 2 decimal places
Template
{the user's Score, round 2}
Output
3.14
Round to whole number
Template
{the user's Rating, round 0}
Output
4
`{the user's Score, round 2}`
`{the user's Rating, round 0}`

Truncation

Shorten long text to a maximum number of characters, with an automatic ... added:

Truncate to 50 characters
Template
{the user's Bio, truncate 50}
Output
Jane is a marketing professional who specializes...
`{the user's Bio, truncate 100}`

Combining Formats

You can combine formatting with other modifiers like math operations:

Math + currency formatting
Template
{the user's Subtotal times 1.08, as "currency"}
Output
$108.00
Discount calculation + Euro
Template
{the user's Price times 0.85, as "currency EUR"}
Output
€85.00
Note

Formatting is always applied after math operations, so you can calculate a value and format the result in a single expression.