2.0.3 • Published 7 years ago

typographic-numbers v2.0.3

Weekly downloads
40
License
MIT
Repository
github
Last release
7 years ago

typographic-numbers Build Status

Micro module for formatting numbers

Install

npm install --save typographic-numbers

Usage

Use typographic numbers depending on your locale for proper thousand separator and decimal point. Use ISO 639 codes to specify locale, example en-uk, ru-ru, da. This module is based on typographic-numbers-l10n-db and choosing proper symbols for every locale.

import numbers from 'typographic-numbers';

numbers('15215', { locale: 'en-us' }); // 15,215
numbers('9015215.215', { locale: 'en-us' }); // 9,015,215.215
numbers('15215 and 15215,215', { locale: 'en-us' }); // 15,215 and 15,215.215
numbers('9015215.215', { locale: 'ru-ru' }); // 9 015 215,215

API

numbers(input, options)

input

Type: string

Text for transform.

options

Type: object

Options to pass locale for proper separator and point symbols.

License

MIT

2.0.3

7 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago

0.2.2

8 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago