+ 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
6 Respuestas
+ 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