Skip to content

Commit a0aa43a

Browse files
Completed mandatory interpret excercise 3
1 parent e109be6 commit a0aa43a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ 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+
// 2. Removes the trailing "p" from the string.
29+
// 3. Adds leading zeros if needed.
30+
// 4. Extracts the pounds value.
31+
// 5. Extracts the pence value.
32+
// 6. Logs the formatted price (£3.99).
33+
// Final output: "£3.99".

0 commit comments

Comments
 (0)