price-to-words-pl

1.0.5 • Public • Published

Price to Words - PL

This library converting a price value into a word representation with a currency.

Instalation

npm install price-to-words-pl

Usage

import PriceFormater from "price-to-words-pl"

const priceFormater = new PriceFormater()

priceFormater.convert(12.54);
//dwanaście złotych i pięćdziesiąt cztery grosze

priceFormater.format = {myFormat: 'zl-number zl and gr-words gr-full'}
priceFormater.convert(12.54);
//12 zł i pięćdziesiąt cztery grosze

Formats

import {CONVERTING_FORMATS} from "price-to-words-pl"
// definition
const CONVERTING_FORMATS = {
    typeA: 'zl-words zl-full and gr-words gr-full', //sto dwadzieścia pięć złotych pięćdziesiąt groszy
    typeB: 'zl-words zl gr-words gr',               //sto dwadzieścia pięć zł pięćdziesiąt gr
    typeC: 'zl-words zl gr-short',                  //sto dwadzieścia pięć zł 50/100
    typeD: 'zl-number zl gr-number gr'              //125 zł 50 gr
}

default: typeA.

Build:

  • Webpack 5
  • Babel 7
  • Jest 27

Package Sidebar

Install

npm i price-to-words-pl

Weekly Downloads

8

Version

1.0.5

License

ISC

Unpacked Size

12.6 kB

Total Files

3

Last publish

Collaborators

  • robert.kaminski