Skip to content

numerals

The digits numbers and dates are written with.

Type'latn' | 'locale'
Default'latn'
Live update (update())Yes
Angularthe [numerals] input
<dz-grid>the numerals attribute
Declared inpackages/dom/src/settings.ts

'latn': 0 to 9, whatever the language. 'locale': the digits the locale writes by default — ١٢٣ for ar-EG, while ar-DZ and ar-MA write 0 to 9 even then, as does every language without digits of its own. It reaches the numbers and dates in the cells.

The grid never leaves the choice to the browser: it decides the digits once and writes them out, so two browsers show the same text.

import { createGrid } from '@dzgrid/dom';
import { AR } from '@dzgrid/dom/locales/ar';
type Well = { id: string; name: string; depth: number };
const grid = createGrid<Well>(document.getElementById('wells')!, {
rows: [{ id: 'w1', name: 'بئر النخلة', depth: 42 }],
columns: [{ id: 'name', header: 'البئر' }, { id: 'depth', header: 'العمق (م)', type: 'number' }],
getRowId: (w) => w.id,
messages: AR,
locale: 'ar-EG',
numerals: 'locale',
});
grid.update({ numerals: 'latn' });

Arabic (ar-EG) with the language's own digits.

  • locale — the language numbers are written in.
  • direction — right to left.