Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

mask-price

lucasbento41MIT1.0.1

Mask cents in formatted price.

mask, price, cents, currency

readme

mask-price

Build Status

Mask a given value as a price.

Install

npm i mask-price -S

Usage

import maskPrice from 'mask-price';

const mask = maskPrice({
  locale: 'pt-BR', // (default is en-US) - format currency based on locale
  cents: false // (default is true) - true/false to return cents
});

console.log(mask(439)); // '4,39'

Kickstarted by npm-boom