-
-
Notifications
You must be signed in to change notification settings - Fork 481
Glasgow Class 6 - Cat Smith -JS1-Week 1 #538
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,7 +5,13 @@ | |||||
Sales tax is 20% of the price of the product. | ||||||
*/ | ||||||
|
||||||
function calculateSalesTax() {} | ||||||
function calculateSalesTax(a) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You've used |
||||||
subTotal = a * .2; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
When declaring your variables, you've ommitted the |
||||||
total = subTotal + a; | ||||||
|
||||||
return total; | ||||||
|
||||||
} | ||||||
|
||||||
/* | ||||||
CURRENCY FORMATTING | ||||||
|
@@ -17,7 +23,12 @@ function calculateSalesTax() {} | |||||
Remember that the prices must include the sales tax (hint: you already wrote a function for this!) | ||||||
*/ | ||||||
|
||||||
function addTaxAndFormatCurrency() {} | ||||||
function addTaxAndFormatCurrency(a) { | ||||||
subTotal = a * .2; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing here with |
||||||
total = subTotal + a; | ||||||
|
||||||
return `£${total .toFixed(2)}` | ||||||
} | ||||||
|
||||||
/* | ||||||
=================================================== | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job using template literals here 👍