Skip to content

Commit 5b9c56b

Browse files
author
russom
committed
Add more function calls for different inputs.
1 parent 2565244 commit 5b9c56b

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎Sprint-3/3-mandatory-implement/3-to-pounds.js‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// You should call this function a number of times to check it works for different inputs
77

8-
function toPound(priceInPence) {
8+
function toPounds(priceInPence) {
99
const penceDigits = priceInPence
1010
.substring(0, priceInPence.length - 1)
1111
.padStart(3, "0");
@@ -16,4 +16,11 @@ function toPound(priceInPence) {
1616

1717
return `£${poundsPart}.${pencePart}`;
1818
}
19-
console.log(toPound("399p"));
19+
console.log(toPounds("399p"));
20+
21+
console.log(toPounds("0p"));
22+
console.log(toPounds("00"));
23+
console.log(toPounds("000"));
24+
console.log(toPounds("01"));
25+
console.log(toPounds("9p"));
26+
console.log(toPounds("58794"));

0 commit comments

Comments
 (0)