Created
August 26, 2021 02:45
-
-
Save bearkfear/63dd02f413fd0eb6aceabfe23f52666b to your computer and use it in GitHub Desktop.
Converte valor monetário para moeda corrente local (currency formatter)
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
export default function currencyFormat(value: string | number): string { | |
return Number(value).toLocaleString("pt-BR", { | |
style: "currency", | |
currency: "BRL", | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment