Skip to content

Commit 8dfc043

Browse files
committed
line 47 - 48 rephrased
1 parent 92a5450 commit 8dfc043

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ console.log(`£${pounds}.${pence}`);
4444

4545
// Line 14-16 created a variable "pence", using the subString(paddedPenceNumberString.length - 2)
4646
// to check the length of the value of the variable "paddedPenceNumberString" which remain 399 from line 8
47-
// The "substring(paddedPenceNumberString.length - 2)" function deducts 3 leaving the last two numbers 99
48-
// PadEnd(2, "0") ensure the value remains 2 and 0 to be added to value less than 2.
49-
// However, we already have in our "pence" variable at a value of 2 numbers "99"
47+
// substring(length - 2) takes the last 2 characters of the padded value, giving us the pence (99)
48+
// padEnd(2, "0") makes sure the value is at least 2 characters long, adding "0" if it is shorter
49+
// in this case the pence value is already 2 characters ("99"), so padEnd adds nothing
5050

5151
// Line 18 printed our codes a formatted style adding the pound sign "£"
5252

0 commit comments

Comments
 (0)