var y = 123e5;
console.log(y); // output: 12300000
Above code has a number variable y
and the output I get is 12300000
. I would like to show it same but as a string. Output should be '123e5' and the type of value also be string. The requirement for such question is that I do not want JS to manipulate my data until I require And If it does than there might also be a way to get the exact value I stored/wrote.
Test values for y
can also be taken as 1023e5
, 1023e+5
, 1023e+5
, 10230e+5
.
<!DOCTYPE html>
<html>
<body>
<pre>
<script>
var y = 123e5;
document.writeln(y);
document.writeln(123e5);
document.writeln(123e+5);
document.writeln(123e-5);
document.writeln(1230e-5);
</script>
</pre>
</body>
</html>
My exact objective was to know that if there is any way I can get the same value stored/wrote without change.So what is the exact way to get my original value.
Thanks!