Skip to content

Commit f267ff6

Browse files
committed
Fix line 29, add a step for line 18
1 parent e773dae commit f267ff6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Sprint-2/3-mandatory-interpret/3-to-pounds.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ console.log(`£${pounds}.${pence}`);
2626
// To begin, we can start with
2727
// 1. const penceString = "399p": initializes a string variable with the value "399p"
2828
// 3-6. const penceStringWithoutTrailingP = penceString.substring(0, penceString.length - 1);
29-
// : initializes a variable, the value of which is turned to numerical by removing the letter "p".
29+
// : initializes a variable, removes the letter 'p'(it's still a string)
3030
// 8. const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0");
3131
// Here the padstart function turns "399" string into 399 number (it could add some zeroes in front, but here it serves as a converter)
3232
// Correct answer: Ensures the string is at least 3 characters long by adding leading zeros if needed. With "399", it stays "399". But if the input were "5p", this would become "005".
3333
// 9-12. const pounds = paddedPenceNumberString.substring(0, paddedPenceNumberString.length - 2);
3434
// Here the goal is to initialize a variable of Pounds (with the value of 3), by splitting it from 99, and it's done using the substring method
3535
// 14-16. const pence = paddedPenceNumberString.substring(paddedPenceNumberString.length - 2).padEnd(2, "0");
3636
// Here the pence variable is introduced with the value of 99 and it's done by taking the 399 and removing 3 using substring and padEnd methods.
37+
// 18. Here we join pounds and pence together and print out the result - the price.

0 commit comments

Comments
 (0)