Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/numeral

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/numeral

TypeScript definitions for Numeral.js

  • 0.0.29
  • ts3.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
574K
increased by7.42%
Maintainers
1
Weekly downloads
 
Created

What is @types/numeral?

@types/numeral provides TypeScript type definitions for the numeral.js library, which is used for formatting and manipulating numbers.

What are @types/numeral's main functionalities?

Number Formatting

This feature allows you to format numbers in various ways, such as adding commas as thousand separators.

const numeral = require('numeral');
const formattedNumber = numeral(1000).format('0,0');
console.log(formattedNumber); // Output: '1,000'

Currency Formatting

This feature allows you to format numbers as currency, including the appropriate currency symbol and decimal places.

const numeral = require('numeral');
const formattedCurrency = numeral(1000).format('$0,0.00');
console.log(formattedCurrency); // Output: '$1,000.00'

Percentage Formatting

This feature allows you to format numbers as percentages, including the percentage symbol and decimal places.

const numeral = require('numeral');
const formattedPercentage = numeral(0.25).format('0.00%');
console.log(formattedPercentage); // Output: '25.00%'

Unformatting

This feature allows you to convert formatted strings back into numbers.

const numeral = require('numeral');
const number = numeral().unformat('$1,000.00');
console.log(number); // Output: 1000

Other packages similar to @types/numeral

FAQs

Package last updated on 07 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc