Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

15 number limit

Status
Not open for further replies.

Ovatvvon

Programmer
Feb 1, 2001
1,514
US
Hopefully someone else has an answer to this...for simeplicities sake, we'll just say I'm making a calculator.

When math functions are completed and the result of the equation ends up being a number that is greater than 15 characters in length, the answer will be displayed with an E like the following

(36156831335 * 36156831335) =

1.30731645218764E+21

when the actual answer should be

1307316452187637882225

It doesn't matter if I use CDbl() or CStr() to try to get the full answer...the answer still remains 1.30731645218764E+21!!

The only way I can make a difference is to use formatNumber(), however that only adds zeros after the standard 15 character memory. Instead of displaying the actual number, it still displays the first 15 digits and then just adds zeros for the rest of the digits that are supposed to be displayed like the following:

1,307,316,452,187,640,000,000


How can I make it so the limit is higher than 15 characters....or better....unlimited?
-Ovatvvon :-Q
 
You can use instr() function to see where the E charcter is and then manually format the number through your code.
It also must be a string, not number of any form.
You won't get it using CDbl(), that's too small.

 
I not only tried CDbl(), but CStr() as well. It didn't work. Removing E wouldn't fix the problem because I don't need the zeros for the rest of the number...I need the actual numbers. But I was able to make it work using CDec(). Thanks for responding though. -Ovatvvon :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top