Skip to content

Number

Number formatting controls what a cell displays. Editing, parsing, validation, precision, and units are separate decisions. Keep the source numeric for numeric sorting, filtering, formulas, and aggregation; do not replace 1234.5 with the text "1,234.50".

NeedUseDependency
Locale-aware numeric entry with precision, bounds and steppingNumber Editor, Currency Editor, Percentage EditorPro
Fixed masks for numeric codes and identifiersMasked EditorPro
A localized display and optional Format Cells dialogcolumn.dataGridFormatPro DataGridFormattingPlugin
An editable numeric column with Numeral masksNumberColumnTypeOptional @revolist/revogrid-column-numeral; no Pro required
Compact, engineering, or unit display with full Intl optionscellTemplate and Intl.NumberFormatCore; your app supplies an editor if needed
Bounded quantities or a visual inputCounter or SliderPro

A format does not automatically install a numeric editor or parse country-specific input. Start with editing and validation for writable columns.

For the Pro recipes below, assume an existing <revo-grid> and this setup:

import { DataGridFormattingPlugin } from '@revolist/revogrid-pro';
const grid = document.querySelector('revo-grid')!;
grid.plugins = [DataGridFormattingPlugin];
grid.source = [{ amount: 1234.5 }];
grid.columns = [{
prop: 'amount', name: 'Amount',
dataGridFormat: {
value: { kind: 'preset', preset: 'number', locale: 'en-US', decimalPlaces: 2 },
},
}];

Merge this plugin into your existing plugin list. The value remains 1234.5; the display is 1,234.50. Right-click a cell and choose Format → More formats… for the interactive dialog. For Core-only usage, skip this setup and follow the standalone Numeral or Intl recipes.

Choose an input control for editable cells.

PageExamples and application
Number EditorLocalized input, precision, bounds, stepping and required values
Currency EditorCurrency amounts and locale-aware entry
Percentage EditorPercentage input with ratio storage
Masked EditorCodes, phone numbers, escaped literals and leading zeros
Numeral editor and masksStandalone numeric column with Numeral masks
CounterIncrement and decrement bounded quantities
SliderAdjust a numeric value visually

Choose how numbers display, then define their storage and validation rules.

PageExamples and application
Integers and decimalsStock counts, decimal quantities, fixed precision, blanks
Currency and accountingInvoices, negative balances, mixed currencies, rounding
Percentages and ratesBI conversion rates, percentage points, basis points
Countries and localesUS, Europe, India, Arabic digits; input contracts
Scientific, compact, and unitsResearch, engineering, dashboards, measurements
Spreadsheet format codesFractions, scaling, zero padding, conditions and literals
Time and durationElapsed hours, clock time, time zones and date serials
Rounding, precision, and signsCash-style increments, significant digits, plus/minus policies
Editing and validationSave numeric values, enforce ranges, reject invalid input

Declare numeric units in your field contract: currency code, major/minor units, fraction/percent, seconds/days. Aggregate raw values before formatting. A ratio KPI usually needs sum(numerator) / sum(denominator), rather than an average of displayed percentages.

For numeric conditions see Number Filter. For workbook output see Excel cell formatting: a display-only template does not automatically define a native Excel number format. For format precedence, reactive presets, custom editors and exact format-code support, see Format Cells.