Skip to content

Commit 12467cc

Browse files
committed
done tp-pounds.js
1 parent 055e578 commit 12467cc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Sprint-2/implement/vat.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,17 @@
88
// Given a number,
99
// When I call this function with a number
1010
// it returns the new price with VAT added on
11+
12+
13+
function addVatporcentage (price) {
14+
const vatIncluded = Number(price * 1.2); //converted the str into number
15+
console.log(typeof vatIncluded);
16+
return `Vat included ${vatIncluded}`;
17+
18+
}
19+
20+
console.log(addVatporcentage("30"));
21+
22+
/*
23+
This will return the new price with the vat included and also converted the string into number with the method Number()
24+
*/

0 commit comments

Comments
 (0)