Socket
Socket
Sign inDemoInstall

@types/numeral

Package Overview
Dependencies
0
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/numeral

TypeScript definitions for numeral


Version published
Maintainers
1
Install size
6.77 kB
Created

Package description

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

Readme

Source

Installation

npm install --save @types/numeral

Summary

This package contains type definitions for numeral (https://github.com/adamwdraper/Numeral-js).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/numeral.

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by Vincent Bortone, Kenneth Luján, Carlos Quiroga, and Piotr Błażejewicz.

FAQs

Last updated on 07 Nov 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc