Skip to content

Commit 7742a7b

Browse files
committed
pound.js update
1 parent 7deb9ec commit 7742a7b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ console.log(`£${pounds}.${pence}`);
2727
// Try and describe the purpose / rationale behind each step
2828

2929
// To begin, we can start with
30+
31+
// Answers
3032
// 1. const penceString = "399p": initialises a string variable with the value "399p"
3133
// 2. const penceStringWithoutTrailingP = penceString.substring(0, penceString.length-1): this
3234
// variable creates a new string that cuts the penceSting to 399,so it basically creates a new
@@ -43,7 +45,7 @@ console.log(`£${pounds}.${pence}`);
4345
// this variable creates a new string from the paddedPenceNumberString variable using the subString
4446
// function. This time it creates a new string from the last 2 indexes. Furthermore it sets the target
4547
// length for this new variable to 2 and if is is less than 2 it sets a condition to add
46-
// a "0" in front
48+
// a "0" at the end by using the padEnd() function
4749

4850

4951
//6. console.log(`£${pounds}.${pence}`); this is a function call that displays the final amount in

0 commit comments

Comments
 (0)