joecool2005 Posted January 26, 2007 Share Posted January 26, 2007 Hi,When I do the following code, it will show me 1e-10 var str=0.0000000001document.write(str)Is it possible to show 0.0000000001?Thx Link to comment Share on other sites More sharing options...
pulpfiction Posted January 26, 2007 Share Posted January 26, 2007 Try with double quotes.....var str="0.0000000001";document.write(str); Link to comment Share on other sites More sharing options...
jesh Posted January 26, 2007 Share Posted January 26, 2007 You might also try "toFixed(n)". var nbr=0.0000000001;document.write(nbr.toFixed(10)); Link to comment Share on other sites More sharing options...
joecool2005 Posted January 26, 2007 Author Share Posted January 26, 2007 Is it possible to determine how many decimals that I have because is not always 10. Link to comment Share on other sites More sharing options...
aspnetguy Posted January 26, 2007 Share Posted January 26, 2007 var str="0.0000000001";var dec = str.split('.')[1].length; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now