@p12/numeral
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

Numeral

format number

Install

npm install @p12/numeral

How to use

Format Props

Name Type Default Description
type NumeralType NumeralType.Token format input
decimalPlaces number? undefined format decimal places

Numeral Type

enum NumeralType {
  GameCoin,
  Token,
  Transfer,
  Balance,
  USD,
}

Numeral

import {numeral, NumeralType} from '@p12/numeral';

const format1 = numeral('1028').format(NumeralType.GameCoin); // 1.028K
const format2 = numeral('1028').format(NumeralType.GameCoin, 2); // 1.03K

Readme

Keywords

none

Package Sidebar

Install

npm i @p12/numeral

Weekly Downloads

1

Version

1.1.3

License

MIT

Unpacked Size

29.2 kB

Total Files

14

Last publish

Collaborators

  • snowoftirisf
  • shallowgreen
  • sixian.yu
  • linchengzzz
  • jerrywang959