# @revolist/revogrid-column-numeral

> Number column type for RevoGrid system based on numeraljs

Latest version **2.0.11** (published 2026-03-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @revolist/revogrid-column-numeral
pnpm add @revolist/revogrid-column-numeral
yarn add @revolist/revogrid-column-numeral
bun add @revolist/revogrid-column-numeral
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.11 |
| Published | 2026-03-04 |
| First published | 2020-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | revolist |
| Maintainers | kumakint |

## Links

- npm: https://www.npmjs.com/package/@revolist/revogrid-column-numeral
- Repository: https://github.com/revolist/revogrid-column-numeral
- Homepage: https://github.com/revolist/revogrid-column-numeral#readme
- Issues: https://github.com/revolist/revogrid-column-numeral/issues
- npm.io page: https://npm.io/package/@revolist/revogrid-column-numeral

## Dependencies (1)

- [numeral](https://npm.io/package/numeral.md) ^2.0.6

## Recent versions

- 2.0.11 (latest) — 2026-03-04
- 2.0.2 (pre-release) — 2024-07-17
- 2.0.10 — 2026-03-04
- 2.0.8 — 2025-02-19
- 2.0.7 — 2025-02-19
- 2.0.6 — 2025-02-19
- 2.0.3 — 2024-12-05
- 2.0.1 — 2024-07-17
- 2.0.0 — 2024-07-17
- 1.0.2 — 2020-10-23
- 1.0.1 — 2020-10-23
- 1.0.0 — 2020-10-23

## README

### 🚨 Repository Notice 🚨

This repo is read-only and will be **deprecated** in v5+ in favor of monorepos. Post issues [here](https://github.com/revolist/revogrid). Happy coding! 🖥️💻

---

# Number Column Type
Number column type for RevoGrid system based on [numeraljs](http://numeraljs.com) library.

Use any format you love to assign number format for your grid.

## Installation

```
npm i @revolist/revogrid-column-numeral
```

## Output

### Number

|Number|Format|String|
|--- |--- |--- |
|10000|'0,0.0000'|10,000.0000|
|10000.23|'0,0'|10,000|
|10000.23|'+0,0'|+10,000|
|-10000|'0,0.0'|-10,000.0|
|10000.1234|'0.000'|10000.123|
|100.1234|'00000'|00100|
|1000.1234|'000000,0'|001,000|
|10|'000.00'|010.00|
|10000.1234|'0[.]00000'|10000.12340|
|-10000|'(0,0.0000)'|(10,000.0000)|
|-0.23|'.00'|-.23|
|-0.23|'(.00)'|(.23)|
|0.23|'0.00000'|0.23000|
|0.23|'0.0[0000]'|0.23|
|1230974|'0.0a'|1.2m|
|1460|'0 a'|1 k|
|-104000|'0a'|-104k|
|1|'0o'|1st|
|100|'0o'|100th|

### Currency

|Number|Format|String|
|--- |--- |--- |
|1000.234|'$0,0.00'|$1,000.23|
|1000.2|'0,0[.]00 $'|1,000.20 $|
|1001|'$ 0,0[.]00'|$ 1,001|
|-1000.234|'($0,0)'|($1,000)|
|-1000.234|'$0.00'|-$1000.23|
|1230974|'($ 0.00 a)'|$ 1.23 m|



## Usage in revo-grid:

```js
import NumberColumnType from '@revolist/revogrid-column-numeral';
const columnTypes = {
    'numeric': new NumberColumnType('0,0')
};
const columns = [
    {
        prop: 'Num',
        name: 'My number',
        columnType: 'numeric'
    },
    {
        prop: 'Num2',
        name: 'My number2',
        columnType: 'numeric'
    }
];
const rows = [{
    'Num': 1000,
    'Num2': 1000
}];

const grid = document.querySelector('revo-grid');
grid.columnTypes = columnTypes;
grid.source = rows;
grid.columns = columns;


// '1,000'
```



## Advanced

If you need to get numeric library instance you can do this as simple as:

```js
import NumberColumnType from '@revolist/revogrid-column-numeral';
const numeral = NumberColumnType.getNumeralInstance;

numeral.register('format', 'percentage', {});
```

Also plugin provides access to beforeValueFormatted instance:
emiter?: (event: string, instance: Numeral)

```js
import NumberColumnType from '@revolist/revogrid-column-numeral';
const columnTypes = {
    'numeric': new NumberColumnType('0,0', (eventName, numeralInstance) => {
        // numeralInstance operations
    }),
};
```

---
_Source: https://npm.io/package/@revolist/revogrid-column-numeral · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
