Skip to content

Instantly share code, notes, and snippets.

@hebertcisco
Created December 4, 2021 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hebertcisco/83715a269a91384846c883f6a4faddb1 to your computer and use it in GitHub Desktop.
Save hebertcisco/83715a269a91384846c883f6a4faddb1 to your computer and use it in GitHub Desktop.
Formatting Money Using Intl
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