1.0.2 • Published 5 years ago

price-tag v1.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Price Tag

A library for formatting currency based on currency code aswell as language codes. This library is designed to be small and fast but it sacrifices on initialization time and data readability. Therefore it is best practise to initialize the currency library as early as possible.

Installation

npm i price-tag

Usage

import PriceTag, {PriceTagData} from 'price-tag'

// fill library with data
const formatter = new PriceTag(PriceTagData)

// set the language and currency codes
let options = formatter.setup("de-DE","EUR")

// localize a value - number, showSymbol, show '.00'
let localizedAmount = formatter.localize(1234.0001,true,true)

console.log(localizedAmount) // €1.234,00
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago