Skip to content

Instantly share code, notes, and snippets.

@kerminz

kerminz/numToCurr.js

Last active Apr 27, 2019
Embed
What would you like to do?
Number To Local Currency Format
// Convert any number to a local currency format with Intl Objects
function numToCurr(number) {
return new Intl.NumberFormat("de-DE", {style: "currency", currency: "EUR"}).format(number)
}
numToCurr(50.00)
// expected output: "50,00 €"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment