-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add currency and number formatting utils
- Loading branch information
1 parent
ed1dfbc
commit 2a889c9
Showing
4 changed files
with
350 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const currency = { | ||
symbol: '$', // default currency symbol is '$' | ||
format: '%s%v', // controls output: %s = symbol, %v = value (can be object, see docs) | ||
decimal: '.', // decimal point separator | ||
thousand: ',', // thousands separator | ||
precision: 2, // decimal places | ||
grouping: 3, // digit grouping (not implemented yet) | ||
}; | ||
const number = { | ||
precision: 0, // default precision on numbers is 0 | ||
grouping: 3, // digit grouping (not implemented yet) | ||
thousand: ',', | ||
decimal: '.', | ||
}; | ||
|
||
export { currency, number }; |
Oops, something went wrong.