@@ -12,12 +12,12 @@ function calculateSalesTax() {}
1212 ===================
1313 The business has informed you that prices must have 2 decimal places
1414 They must also start with the currency symbol
15- Write a function that transforms numbers into the format £0.00
15+ Write a function that adds tax to a number, and then transforms the total into the format £0.00
1616
1717 Remember that the prices must include the sales tax (hint: you already wrote a function for this!)
1818*/
1919
20- function formatCurrency ( ) { }
20+ function addTaxAndFormatCurrency ( ) { }
2121
2222/* ======= TESTS - DO NOT MODIFY =====
2323There are some Tests in this file that will help you work out if your code is working.
@@ -41,6 +41,6 @@ test("calculateSalesTax function - case 1 works", calculateSalesTax(15), 18)
4141test ( "calculateSalesTax function - case 2 works" , calculateSalesTax ( 17.5 ) , 21 )
4242test ( "calculateSalesTax function - case 3 works" , calculateSalesTax ( 34 ) , 40.8 )
4343
44- test ( "formatCurrency function - case 1 works" , formatCurrency ( 15 ) , "£18.00" )
45- test ( "formatCurrency function - case 2 works" , formatCurrency ( 17.5 ) , "£21.00" )
46- test ( "formatCurrency function - case 3 works" , formatCurrency ( 34 ) , "£40.80" )
44+ test ( "addTaxAndFormatCurrency function - case 1 works" , addTaxAndFormatCurrency ( 15 ) , "£18.00" )
45+ test ( "addTaxAndFormatCurrency function - case 2 works" , addTaxAndFormatCurrency ( 17.5 ) , "£21.00" )
46+ test ( "addTaxAndFormatCurrency function - case 3 works" , addTaxAndFormatCurrency ( 34 ) , "£40.80" )
0 commit comments