Last active
August 30, 2016 13:05
-
-
Save codyogden/7e02c5e72b4dcb90719c850237b89fb2 to your computer and use it in GitHub Desktop.
USD Currency Locale Functions
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
// Show two decimal places, returns a string | |
VARIABLE.toFixed(2); | |
// Show as USD Currency | |
VARIABLE.toLocaleString( 'USD', { style: 'currency', currency: 'USD' } ); | |
// Show as USD Currency with commas | |
VARIABLE.toLocaleString( 'en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 } ); | |
// Hi matt! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment