Skip to content

Commit 41d76e2

Browse files
committed
Exaplined why implement 4 different functions in this file.
1 parent 9b3eb4b commit 41d76e2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ const convertToUpperSnakeCase = (str) =>
2424
str.toUpperCase().trim().split(" ").join("_");
2525

2626
console.log(convertToUpperSnakeCase("hello there")); // "HELLO_THERE"
27+
28+
// Four functions are implemented because each one performs a specific task.
29+
// This makes the code easier to read, reuse, and maintain.
30+
//
31+
// The penceToPounds function was updated to handle a pence string like "399p".
32+
// It removes the "p", converts the value to a number, and divides by 100
33+
// so the function correctly returns "£3.99".s

0 commit comments

Comments
 (0)