Skip to content

Commit 0a8af10

Browse files
committed
done vat.js
1 parent a40458c commit 0a8af10

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Sprint-2/implement/vat.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,16 @@
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+
return `Vat included ${vatIncluded}`;
16+
17+
}
18+
19+
console.log(addVatporcentage("30"));
20+
21+
/*
22+
This will return the new price with the vat included and also converted the string into number with the method Number()
23+
*/

0 commit comments

Comments
 (0)