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

Package detail

number-formatter-util

alex-lenk18MIT1.0.6

numberFormatterUtil is a powerful and flexible library for number formatting in JavaScript.

number-formatting, javascript, number-converter, decimal-formatting, currency-formatting, localization, number-parser, npm-package, frontend, utilities

readme

Description:

numberFormatterUtil is a powerful and flexible library for number formatting in JavaScript.

Peculiarities

  • Supports various number formats.
  • Functions to convert strings to numbers and vice versa.
  • Localization and currency formatting.

Installation

npm i number-formatter-util

Example of usage

import numberFormatter from 'number-formatter-util';

const formatter = numberFormatter({
  decimals: 0,
});

console.log(formatter(12345.678)); // Example output: "12345"
console.log(formatter.to(12345.678)); // Example output:: "12,345.68"
console.log(formatter.from("12,345.68")); // Example output:: 12345.68

License

This project is licensed under the MIT license.

Contact the author

If you have questions or suggestions, please contact me at https://github.com/alex-lenk