Results 1 to 10 of 10

Thread: Cint, dbl, etc.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323

    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.

  2. #2
    Lively Member
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    115
    Not sure if this is what you meant...

    Code:
    long_number = right("0000000000000000" & short_number,16)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323
    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.

  4. #4
    Lively Member
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    115
    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?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323
    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.

  6. #6
    Lively Member
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    115
    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?

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323
    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.

  8. #8
    Lively Member
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    115
    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.

  9. #9
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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..

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323
    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
  •  



Click Here to Expand Forum to Full Width