Skip to content

Commit e2a617b

Browse files
committed
Implement convertToPercentage function to calculate percentage from decimal input
1 parent 31d1742 commit e2a617b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • Sprint-3/1-key-errors

‎Sprint-3/1-key-errors/1.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@
2525

2626
// Finally, correct the code to fix the problem
2727
// =============> write your new code here
28+
function convertToPercentage(decimalNumber){
29+
const percentage = `${decimalNumber * 100}%`;
30+
return percentage;
31+
}
32+
console.log(convertToPercentage(0.5));

0 commit comments

Comments
 (0)