1.1.3 • Published 1 year ago

@p12/numeral v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Numeral

format number

Install

npm install @p12/numeral

How to use

Format Props

NameTypeDefaultDescription
typeNumeralTypeNumeralType.Tokenformat input
decimalPlacesnumber?undefinedformat 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