New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@jf/format-decimal

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jf/format-decimal

Format thousands and decimals with custom separator

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

@jf/format-decimal stable

Format thousands and decimals with custom separator: 1.000.000,00

Options

You can pass a configuration object as second parameter with the following keys:

  • decimal: Symbol to use for decimal point (default: ,).
  • precision: Number of decimal digits to show (default: 2).
  • thousands: Symbol to use for thousands separator (default: .).

Usage

npm install @jf/format-decimal

const formatDecimal = require('format-decimal');

console.log(formatDecimal(123456.789)); // 123.456,79
console.log(
    formatDecimal(
        123456.789,
        {
            decimal   : '.',
            precision : 1,
            thousands : ','
        }
    )
); // 123,456.8

Keywords

pretty

FAQs

Package last updated on 24 Apr 2025

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