Created
December 4, 2021 13:47
-
-
Save hebertcisco/83715a269a91384846c883f6a4faddb1 to your computer and use it in GitHub Desktop.
Formatting Money Using Intl
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
import Intl from 'intl'; | |
import 'intl/locale-data/jsonp/pt-BR'; | |
export const moneyFormat = (value: number) => { | |
return new Intl.NumberFormat('pt-BR', { | |
style: 'currency', | |
currency: 'BRL', | |
}).format(value); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment