File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
Sprint-2/3-mandatory-implement Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -11,17 +11,16 @@ function toPounds(penceString) {
1111 penceString . length - 1
1212 ) ;
1313
14+ const paddedPenceNumberString = penceStringWithoutTrailingP . padStart ( 3 , "0" ) ;
15+ const pounds = paddedPenceNumberString . substring (
16+ 0 ,
17+ paddedPenceNumberString . length - 2
18+ ) ;
1419
15- const paddedPenceNumberString = penceStringWithoutTrailingP . padStart ( 3 , "0" ) ;
16- const pounds = paddedPenceNumberString . substring (
17- 0 ,
18- paddedPenceNumberString . length - 2
19- ) ;
20-
21- const pence = paddedPenceNumberString
22- . substring ( paddedPenceNumberString . length - 2 )
23- . padEnd ( 2 , "0" ) ;
24- return `£${ pounds } .${ pence } ` ;
20+ const pence = paddedPenceNumberString
21+ . substring ( paddedPenceNumberString . length - 2 )
22+ . padEnd ( 2 , "0" ) ;
23+ return `£${ pounds } .${ pence } ` ;
2524}
2625
27- console . log ( `£${ pounds } .${ pence } ` ) ;
26+ console . log ( `£${ pounds } .${ pence } ` ) ;
You can’t perform that action at this time.
0 commit comments