ReoGrid ReoGrid Web
number-format currency percentage

Number Formatting

Format numbers as currency, percentages, dates, and custom patterns — a reference of all supported format codes.

How it works

This demo is a living reference for ReoGrid's number format codes. Each row shows a raw value alongside multiple format codes and their rendered output.

  • Currency formats: ¥#,##0 for Japanese yen, $#,##0.00 for US dollars, and locale-aware patterns
  • Percentage formats: 0% for whole numbers, 0.00% for two decimal places
  • Date formats: yyyy/mm/dd, mm/dd/yyyy, and Japanese era formats (令和, 平成, 昭和)
  • Custom patterns: zero-padding, conditional coloring with [Red], text literals mixed with numbers
  • All format codes follow the same Excel-compatible syntax — existing Excel format strings work as-is

Key APIs used

ws.setCellNumberFormat(row, col, formatCode)

Apply a format code string (e.g. '¥#,##0', '0.00%', 'yyyy/mm/dd') to a cell

ws.range(ref).setNumberFormat(formatCode)

Apply the same format code to all cells in a range

ws.cell(row, col).setValue(value)

Set the raw numeric value that the format code will be applied to

Related Documentation

Related Demos

Stay Updated

Be first to know — get updates as they ship

Get notified of new releases, features, and announcements.
No spam — just updates that matter.