(locale = "en-US", currency = "USD", value)
| 5 | |
| 6 | // Helper function to format currency numbers. Used by tipCalculator |
| 7 | const formatter = (locale = "en-US", currency = "USD", value) => { |
| 8 | let formattedValue = new Intl.NumberFormat(locale, { |
| 9 | style: "currency", |
| 10 | currency: currency, |
| 11 | }).format(value); |
| 12 | |
| 13 | return formattedValue; |
| 14 | }; |
| 15 | |
| 16 | // Callback receives finalTip object, creates and outputs table on the DOM. |
| 17 | const printHTML = (finalTip) => { |