WFP logoDesign System
Guidelines

Numbers and units

How to format numbers, currency, and units of measure in interface text.

Use numerals

✅ Do

5 unread messages

❌ Don’t

Five unread messages

Use Intl.NumberFormat

To format numbers, currency, and units in interfaces, use Intl.NumberFormat – a built-in JavaScript function that formats numeric values according to locale and preferences.

To localize output, pass a locale as the first argument:

LanguageLocale code
English (British)en-GB
Frenchfr
Spanishes
Arabicar

For form-related use cases, keep the raw numeric value in state and apply Intl formatting only when rendering labels, summaries, or read-only values.

Numbers

Use commas to group thousands

✅ Do

100,000

❌ Don’t

100000

Examples

Use plain decimal formatting for grouped thousands.

Optionally, use notation: "compact" for large values such as millions.

123,456.79

default

123k

compact
const value = 123456.789;

const formatNumber = new Intl.NumberFormat("en-GB", {
  maximumFractionDigits: 2,
}).format(value);

const formatNumberCompact = new Intl.NumberFormat("en-GB", {
  notation: "compact",
}).format(value);

For grouping, notation, and precision options, see MDN: digit and notation options.

Units

Use abbreviations

Use the following abbreviations from the WFP Editorial Style Guide:

UnitSymbol
Metresm
Square metresm2
Cubic metresm3
Kilometreskm
Hectaresha
Metric tonsmt
Gramsg
Kilocalorieskcal

Don’t write the unit in full.

✅ Do

0.35 kg

❌ Don’t

0.35 kilograms

No punctuation after the unit.

✅ Do

5.7 km

❌ Don’t

5.7 km.

Leave a space between value and unit.

✅ Do

100,000 mt

❌ Don’t

100,000mt

Examples

Use style: "unit" with the unit you need.

5,678 m

Metres

5.7 km

Kilometres

350 g

Grams

0.35 kg

Kilograms

75 ha

Hectares

3 l

Litres
const formatMetres = new Intl.NumberFormat("en-GB", {
  style: "unit",
  unit: "meter",
}).format(5678);

const formatKilometres = new Intl.NumberFormat("en-GB", {
  style: "unit",
  unit: "kilometer",
}).format(5.7);

const formatGrams = new Intl.NumberFormat("en-GB", {
  style: "unit",
  unit: "gram",
}).format(350);

const formatKilograms = new Intl.NumberFormat("en-GB", {
  style: "unit",
  unit: "kilogram",
}).format(0.35);

const formatHectares = new Intl.NumberFormat("en-GB", {
  style: "unit",
  unit: "hectare",
}).format(75);

const formatLitres = new Intl.NumberFormat("en-GB", {
  style: "unit",
  unit: "liter",
}).format(3);

For abbreviations that are not supported by Intl.NumberFormat, format the number with Intl and append the abbreviation manually.

120 m2

Square metres

500 m3

Cubic metres

2,000 kcal

Kilocalories
const formatSquareMetres = `${new Intl.NumberFormat("en-GB").format(120)} m2`;

const formatCubicMetres = `${new Intl.NumberFormat("en-GB").format(500)} m3`;

const formatKilocalories = `${new Intl.NumberFormat("en-GB").format(2000)} kcal`;

Percentages

Use %

Use the % sign, with no space before it.

✅ Do

16%

❌ Don’t

16 %

❌ Don’t

16 percent

❌ Don’t

16 per cent

Examples

Use style: "percent" and pass decimal input values.

16%

const formatPercentage = new Intl.NumberFormat("en-GB", {
  style: "percent",
}).format(0.16);

Currency

Use ISO currency codes

✅ Do

USD 43.2m

❌ Don’t

$ 43.2m

✅ Do

EUR 15,400,000

❌ Don’t

15,400,000 €

Examples

Use style: "currency" with the target currency code.

Use currencyDisplay: "code" to show the ISO code instead of a symbol.

USD 1,234,567.89

United States dollar

EUR 1.2m

Euro (compact)
const value = 1234567.89;

const formatUSDollar = new Intl.NumberFormat("en-GB", {
  style: "currency",
  currency: "USD",
  currencyDisplay: "code",
}).format(value);

const formatEuroCompact = new Intl.NumberFormat("en-GB", {
  style: "currency",
  currency: "EUR",
  currencyDisplay: "code",
  notation: "compact",
}).format(value);