Cogito said:
I am using a javascript function to generates large numbers. It
appears that when the number exceeds 20 digits it is displayed in
scientific notation, that is, a base and an exponent. Is there a way
to avoid this and display the complete number instead?
One thing to keep in mind is that JS can handle only 20+ digits, so any
numbers too small or too large to be held within this limit must be
truncated, rounded off, or expressed in scientific notation. Also, be
aware that if you are working with everyday base 10 calculations,
calculations made on digital computers are done in a base 2, or
multiples thereof, number system - binary, octal, hex, etc. If you
calculate using decimal fractions such as in dollars and cents, a
result that should be $2, for example might be given as 1.999999999999
because some numbers used in a calculation can not be represented
exactly in either a base 10 or base 2 number system. You likely can
find more information about this in the FAQs at the Usenet group
comp.lang.javascript, where a link to the FAQs usually is posted every
few days.