Skip to content

Commit dc6b184

Browse files
committed
Format percentage output to one decimal place
1 parent d6fd51e commit dc6b184

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • Sprint-3/1-key-errors

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ console.log(decimalNumber);*/
2121
// Finally, correct the code to fix the problem
2222
// =============> write your new code here
2323
function convertToPercentage(decimalNumber) {
24-
const percentage = `${decimalNumber * 100}%`;
24+
const percentage = `${(decimalNumber * 100).toFixed(1)}%`;
2525

2626
return percentage;
2727
}

0 commit comments

Comments
 (0)