MCPcopy Create free account
hub / github.com/LinkedInLearning/javascript-essential-training-2832077 / formatter

Function formatter

08_10e/script.js:7–14  ·  view source on GitHub ↗
(locale = "en-US", currency = "USD", value)

Source from the content-addressed store, hash-verified

5
6// Helper function to format currency numbers. Used by tipCalculator
7const 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.
17const printHTML = (finalTip) => {

Callers 1

tipCalculatorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected