Skip to content

Commit f29a1e0

Browse files
I explained why the padEnd function is not necessary in this program.
1 parent 5124da0 commit f29a1e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sprint-1/3-mandatory-interpret/3-to-pounds.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ This line extracts the pounds part by taking all characters except the last two
4242
.substring(paddedPenceNumberString.length - 2)
4343
.padEnd(2, "0");
4444
This line extracts the last two characters (representing pence) and ensures they are exactly two digits long by padding with trailing zeros if necessary, resulting in "99".
45-
45+
however the padEnd is not necessary in this case because the substring will alwayes return 2 characters since we have already padded the string to be at least 3 characters long in the previouse Step.
4646
6. console.log(${pounds}.${pence}`);
4747
This line logs the formatted price in pounds and pence, e.g., £03.99.

0 commit comments

Comments
 (0)