Skip to content

frontid/formatCurrency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Number.formatCurrency()

Number.formatCurrency() is a wrapper for Intl.NumberFormat() making easy format amounts.

Usage

<script src="currency-formatter.js"></script>
const usdFormatted = 23565.formatCurrency();
// OUTPUTS: $23,565

// With all available options (Showing the symbol, EUR formatted with Spanish Spain locale):
const formattedCurrency = 23565.formatCurrency(true, 'EUR', 'es-ES');
// OUTPUTS: 23.565 €

About

Javascript format currency method for numbers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published