MCPcopy Index your code
hub / github.com/LinkedInLearning/javascript-essential-training-2832077 / tipCalculator

Function tipCalculator

08_08e/script.js:19–29  ·  view source on GitHub ↗
(sum, percentage, locale, currency)

Source from the content-addressed store, hash-verified

17};
18
19const tipCalculator = (sum, percentage, locale, currency) => {
20 let tip = sum * (percentage / 100);
21 let total = sum + tip;
22
23 console.log(`
24 Sum before tip: ${formatter(locale, currency, sum)}
25 Tip percentage: ${percentage}%
26 Tip: ${formatter(locale, currency, tip)}
27 Total: ${formatter(locale, currency, total)}
28 `);
29};
30
31tipCalculator(29.95, 18, "de-DE", "EUR");

Callers 1

script.jsFile · 0.70

Calls 1

formatterFunction · 0.70

Tested by

no test coverage detected