0

I have this number 0.020928116469517644 And I want to get the percentage, e.g. 2% in this case. How can I do this? Thanks in advance.

1 Answers1

2
function percentage(x) {
   return Math.round(100*x) + '%'
}

answer = percentage(0.020928116469517644)

Also note that in this example, the percentage is 2% and not 20%

Catch22
  • 391
  • 2
  • 5