File tree Expand file tree Collapse file tree
Sprint-1/3-mandatory-interpret Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,3 +25,10 @@ console.log(`£${pounds}.${pence}`);
2525
2626// To begin, we can start with
2727// 1. const penceString = "399p": initialises a string variable with the value "399p"
28+
29+ // line 1 creating a string containing price in pence and this is starting value that programme will convert into pound.
30+ // line 3 removing p from the end of 399p because p is not needed when converting into pound or pence.
31+ // line 8 making sure string has at least 3 digit by adding zero if needed and this makes easier to separate pound and pence consistently.
32+ // line 9 extract everything except last two digit .
33+ // line 14 extract last two digit and padEnd() ensures the pence part always has 2 digits.
34+ // line 18 to print value for checking .
You can’t perform that action at this time.
0 commit comments