There was an error while loading. Please reload this page.
1 parent 4340677 commit 11f2fe4Copy full SHA for 11f2fe4
1 file changed
Sprint-1/3-mandatory-interpret/3-to-pounds.js
@@ -25,3 +25,8 @@ console.log(`£${pounds}.${pence}`);
25
26
// To begin, we can start with
27
// 1. const penceString = "399p": initialises a string variable with the value "399p"
28
+// [ChunYanWong] line 3 is used to remove the character "p" or the unit penny
29
+// [ChunYanWong] line 8 is used to add three 0 in front of the variable penceStringWithoutTrailingP
30
+// [ChunYanWong] line 9 is used to get the nearest pound from the variable above
31
+// [ChunYanWong] line 14 is used to get the remaining penny after converting to the nearest pound
32
+// [ChunYanWong] line 18 is used to display the result in pound and penny respectively
0 commit comments