numeral
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
Numeral.js is a popular JavaScript library that provides functionality for formatting and manipulating numbers. It's a handy tool to have, especially when dealing with large numerical data or when you need to format numbers in a specific way for your application or website.
To use Numeral.js, you first need to install it via npm, using the command npm install numeral
. After it has been installed, you can require it in your JavaScript file using const numeral = require('numeral')
.
You can manipulate and format numbers using various functions provided by the library.
Here are a few examples:
let number = numeral(1000);
let formatted = number.format('0,0');
// Output: '1,000'
let value = numeral().unformat('($10,000.00)');
// Output: -10000
let number = numeral(1000);
let added = number.add(100);
// Output: 1100
In each usage case, you start by creating a numeral
instance of your number, then apply the appropriate function depending on your needs.
The official documentation for Numeral.js can be found on their website. The documentation provides full details on how to use the library, including how to install it, how to perform various number manipulations and formatting, among other things. It also contains information on how to contribute to the project, and the history of the changelog for the package.