+ 10

How convert any number into percentage?

I have a number of 50, how can I convert it into percentages, to make it 50%

8th Jul 2019, 3:10 PM
cadbrooke
cadbrooke - avatar
5 Answers
+ 6
var num = 50; var percentage = `${num}%`;
9th Jul 2019, 3:56 AM
InvBoy [ :: FEDE :: ]
InvBoy [ :: FEDE :: ] - avatar
+ 6
50 + '%' or, '${num}%' :)
9th Jul 2019, 4:26 AM
Ayan Fox
Ayan Fox - avatar
+ 4
console.log(50 + '%')
8th Jul 2019, 3:25 PM
CalviÕ²
CalviÕ² - avatar
+ 4
concat 50+'%' its very useful when using javscript with html to adjust dom style attributes.
9th Jul 2019, 3:42 AM
Danielov
Danielov - avatar
+ 2
function numberToPercentage(num) { return num+'%'; }
9th Jul 2019, 8:13 PM
ŠœŠøŠŗŠ¾Š»Š° Š¤ŠµŠ“Š¾ŃŃ”Ń”Š²
ŠœŠøŠŗŠ¾Š»Š° Š¤ŠµŠ“Š¾ŃŃ”Ń”Š² - avatar