Last active
April 13, 2022 17:20
-
-
Save juliovt-07/fa66d584d3200c0ab80a2057c007beee to your computer and use it in GitHub Desktop.
Formatação de moeda
This file contains 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
const formatCurrency = (value) => { | |
return value.toLocaleString('pt-BR', { | |
style: 'currency', | |
currency: 'BRL' | |
}) | |
} | |
// <- formatCurrency(20000) | |
// -> R$ 20.000,00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment