Skip to content

Commit 3ea132c

Browse files
Committing the explanation of the program as step 6
1 parent 837e3ef commit 3ea132c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ console.log(`£${pounds}.${pence}`);
4242
// The substring(paddedPenceNumberString.length - 2) takes the last two characters as the pence part "399" and converts it into "99"
4343
// The .padEnd(2, "0") ensures the pence part is always 2 digits by adding trailing zeros if needed.
4444
// In most cases there are already two digits, however part of the code protects against edge cases such as "3" becoming "30" which would be an inaccurate outcome.
45+
46+
// 6. console.log(`£${pounds}.${pence}`);
47+
// Prints the final formatted price in pounds and pence. An example would be "399p" would print as "£3.99

0 commit comments

Comments
 (0)