Skip to content

Latest commit

 

History

History

number

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Acrool JS Utils / Number

Handling currency formatting, decimal point retention, and obtaining the difference between two ranges.

Features

numToDecimal2

Keep the second decimal place

import {numToDecimal2} from '@acrool/js-utils/number'

numToDecimal2(2000)
// 2000.00

formatCurrency

Thousands formatting

import {formatCurrency} from '@acrool/js-utils/number'

formatCurrency(2000)
// 2,000
formatCurrency(2000, true)
// 2,000.00

intersectionMin

Get the minimum range of intersection in an array

import {intersectionMin} from '@acrool/js-utils/number'

intersectionMin([ [1, 20], [5, 24] ])
// {min: 5, max: 20}