|
-
Jun 25th, 2001, 02:07 PM
#1
Thread Starter
Hyperactive Member
Cint, dbl, etc.
How would I make a number 16 characters long (CC Number) display on the screen without any deformation?
Thanks.
If you think education is expensive, try ignorance.
-
Jun 25th, 2001, 02:31 PM
#2
Lively Member
Not sure if this is what you meant...
Code:
long_number = right("0000000000000000" & short_number,16)
-
Jun 25th, 2001, 02:45 PM
#3
Thread Starter
Hyperactive Member
What I'm doing is taking an integer out of a database and trying to display it on the screen. If I just try to write it (rst("whatever")) Then it looks like this:
1.23456781234568E+15
Whatever I try to do from there is not working because it's already rounded it at the end (68E... instead of 678).
Any help would be greatly appreciated.
If you think education is expensive, try ignorance.
-
Jun 25th, 2001, 03:13 PM
#4
Lively Member
Aren't there any properties for that field in the dbase, so that it doesn't round it?
And when there is such big numbers as it is here.. is it such a big deal if the last digit is rounded?
-
Jun 25th, 2001, 03:18 PM
#5
Thread Starter
Hyperactive Member
It looks fine in the database, I just can't get it to display on the page the same as it looks in the database. It's a credit card number which is why it's 16 digits so yes it is important that we record the correct one also.
If you think education is expensive, try ignorance.
-
Jun 25th, 2001, 03:29 PM
#6
Lively Member
Hehe.. if it's a credit card-number I can understand that 
If you don't need to make any mathematical operations on it, why not save it in the dbase as a string?
-
Jun 25th, 2001, 03:34 PM
#7
Thread Starter
Hyperactive Member
I wish that were something that took place before all of this. I am trying to work with someone elses code and this is the only step I am unable to make it past. I can go into the other pages that reference this application and rewrite them but that's a pain.
Is there no other options?
If you think education is expensive, try ignorance.
-
Jun 25th, 2001, 03:55 PM
#8
Lively Member
Can only think of one thing...
int(rst("whatever"))
I'm sure there must be some way, if this doesn't work, but I don't know exactly how... take a look at MSDN if you can find anything.
-
Jun 26th, 2001, 12:37 PM
#9
Frenzied Member
You have to use a long not an int. Int is not big enough to handle it. It really should have been stored as a string initially. But, since that isn't possible now.. let's see..
Have you tried using FormatNumber() ?
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Jun 26th, 2001, 02:14 PM
#10
Thread Starter
Hyperactive Member
Yes I have, but that's not successful either.
The problem I'm having when doing that is the number is rounded to 15 numbers and a 0 at the end.
(ie. - 1234567812345678 would be 1.234567812345680)
I am very close to fixing it, but it's still not working exactly right.
As of right now I have found that if I manually change all numbers to having a letter before the numbers it reads it as a string and it works fine.
I just have to write a script which adds a letter (a) to the beginning of each number and write it back to itself. That shouldn't be a problem except I'm writing to a .csv file instead of a db which I'm not familiar with. I get an error when trying to add an "a" before the number which tells me it's a type mismatch. I don't know how it knows it's supposed to be a number field instead of a text field.
Thanks for any help.
If you think education is expensive, try ignorance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|