Convert hexadecimal integer to float with parseFloat() in JavaScript

Description

The following code shows how to convert hexadecimal integer to float with parseFloat().

Example


<!-- ww w  .  j  a  v  a 2 s.  c  om-->

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
document.writeln(parseFloat("0xFF"));
</script>
</head>
<body>
</body>
</html>

Click to view the demo

The code above generates the following result.

Convert hexadecimal integer to float with parseFloat() in JavaScript
Home »
  Javascript Tutorial »
    Data Type »
      Number parseFloat
Javascript Tutorial Number parseFloat
Convert "1234asdf" to float with parseFloat...
Convert hexadecimal integer to float with p...
Convert string in Scientific notation to fl...
Convert string to create an integer or real...
Convert string with initial zeros to float ...