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

number-to-readable-text

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

number-to-readable-text

numberFormatter() function converts a number (Works both with integer and float types) to string with point and decimal separators.

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

number-to-readable-text

Description

numberFormatter() function converts a number (Works both with integer and float types) to string with point and decimal separators.

Install

npm i number-to-readable-text

Usage

const numberFormatter = require('number-to-readable-text');

numberFormatter(<number>, <options>);

console.log(numberFormatter(1000000.12)) // output > '1.000.000,12'

Arguments

  • number (required)

  • options (optional)

Options

OptionTypeDescriptionDefault
decimalSeparatorstringdecimalSeparator has to be a string of a dot ('.') or a comma (',').(',')
forceShowDecimalsbooleanTrue adds two zeros as decimals even if the given number is integer.false

Exceptions

Function return false if the given number argument is not a valid number. If the separator is not a comma or a dot string the EU format is used as default

Repository

git@github.com:GkChris/number_to_readable_text.git

Keywords

numbers

FAQs

Package last updated on 05 Jun 2023

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