You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 2. const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"): creates a new string variable that pads the original string with leading zeros to make it 3 characters long
31
31
// 3. const pounds = paddedPenceNumberString.substring(0, paddedPenceNumberString.length - 2): extracts the pounds portion of the string by taking all characters except the last two
32
32
// 4. const pence = paddedPenceNumberString.substring(paddedPenceNumberString.length - 2).padEnd(2, "0"): extracts the pence portion of the string by taking the last two characters and pads it with trailing zeros to make it 2 characters long
33
-
// 5. console.log(`£${pounds}.${pence}`): outputs the final formatted price in pounds and pence to the console
33
+
// 5. console.log(`£${pounds}.${pence}`): outputs the final formatted price in pounds and pence to the console
0 commit comments