I'm using

**java **to convert a number

This is the JavaScript forum. Java and Javascript are entirely different programming languages, in spite of the confusingly similar names. Rather like Austria and Australia!

See: scientific notation of numbers

You convert a positive or negative scientific format number to standard decimal simply with *1. But 2.47105381e-16 is too big a number for Javascript to handle.

Code:

<input type = "text" id = "txt1" value = 1e06>
<input type = "text" id = "txt2">
<input type = button value = "Click" onclick = "makeNumber()">
<script type="text/javascript">
function makeNumber() {
var x = document.getElementById("txt1").value;
document.getElementById("txt2").value = x*1;
}
</script>

Further examples to study:-

Code:

<script type="text/javascript">
alert (Math.pow(10,20);
alert (Math.pow(10,21)); // Javascript can display numbers up to 10 ^ 20, thereafter in scientific/exponential notation.
alert (parseFloat(1.51e-6)); // returns 0.00000151
alert (parseFloat(1.23e-7)); // returns 1.23e-7
// You can use toFixed() instead of parseFloat() to format **positive** numbers the way you want up to 20 places of decimals.
// For example (1.23e-7).toFixed(9) will render as 0.000000123
alert (2.47105381e-16.toFixed(20)); // returns **positive** value
alert ((-2.47105381e-16).toFixed(20)); // using parentheses returns negative value
alert (2.47105381e-16.toFixed(21)); // out of range
// Using .toFixed() with **negative** numbers requires the value to be placed in parentheses as, due to operator precedence, negative numbers don't return a string.
alert (-1.23e-2.toFixed(9)); // -0.0123
alert (-1.23e-4.toFixed(9)); // -0.000123
alert ((-1.23e-4).toFixed(9)); // -0.000123000
</script>