formatnumber-to-naira
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

formatnumber-to-naira

npm version

Description

formatnumber-to-naira is a utility that formats a given number into Nigeria's currency (NGN) format.

Installation

You can install the package using npm. Make sure you have Node.js and npm installed.

npm install formatnumber-to-naira

Usage

New way

  • from version 2.0.0
import { formatPrice } from 'formatnumber-to-naira';

const price = 1234567.89;
const formattedPrice = formatPrice(price);
console.log(formattedPrice); // Output: "₦1,234,567.89"

Old way

  • from version 1.0.0 to 1.0.7
import formatPrice from 'formatnumber-to-naira';

const price = 1234567.89;
const formattedPrice = formatPrice(price);
console.log(formattedPrice); // Output: "₦1,234,567.89"

Package Sidebar

Install

npm i formatnumber-to-naira

Weekly Downloads

55

Version

2.0.1

License

MIT

Unpacked Size

2.74 kB

Total Files

6

Last publish

Collaborators

  • josephe44
  • balmofcodes