Last active
April 27, 2019 10:05
-
-
Save kerminz/8ab2d87e11eebcc872b63f561c1e52ad to your computer and use it in GitHub Desktop.
Number To Local Currency Format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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