1.0.11 • Published 2 years ago
funky-number v1.0.11
funky-number
Description
Easily format a number to string with decimal and point separators
Install
npm i funky-number
Usage
const funkyNumber = require('funky-number');
funkyNumber(<number>, <decimalSeparator>);
console.log(funkyNumber(1000000.12))
[output] > '1.000.000,12'
Arguments
number (required)
decimalSeparator (optional)
decimalSeparator argument
decimalSeparator has to a string of a dot ('.') or a comma (',').
Exceptions
Function return false if the given number argument is not a valid number. If the separator is not a comma or a dot string the EU format is used as default