Answers for "change px string to number"

0

change px string to number

parseFloat('20.954544px', 10)
> 20.954544
parseInt('20.954544px', 10)
> 20
a = '20px'
parseInt(a, 10);
> 20
Posted by: Guest on March-16-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language