To convert a value from string to float, we have to use the function or method "parseFloat() to convert a string value to float.
Example:
parseFloat("4.333"); // 4.333
parseFloat("5aaa"); // 5
parseFloat("6e2"); // 600
parseFloat("aaa"); // NaN (means "Not a Number")
Hiç yorum yok:
Yorum Gönder