There was an error while loading. Please reload this page.
1 parent 2565244 commit 5b9c56bCopy full SHA for 5b9c56b
1 file changed
Sprint-3/3-mandatory-implement/3-to-pounds.js
@@ -5,7 +5,7 @@
5
6
// You should call this function a number of times to check it works for different inputs
7
8
-function toPound(priceInPence) {
+function toPounds(priceInPence) {
9
const penceDigits = priceInPence
10
.substring(0, priceInPence.length - 1)
11
.padStart(3, "0");
@@ -16,4 +16,11 @@ function toPound(priceInPence) {
16
17
return `£${poundsPart}.${pencePart}`;
18
}
19
-console.log(toPound("399p"));
+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