File tree Expand file tree Collapse file tree
Sprint-2/3-mandatory-interpret Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments