CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Location
    Holland
    Posts
    146

    Calculating with very large numbers

    Hi,
    I have to calculate the controlnumber in an IBAN bank account number.
    First i have to change the a part of the account numer to a string with only 0 to 9

    This is what is should be:

    Dim Amount1 as ???
    dim Amount2 as ???
    dim amount3 as ???
    dim Temp as string

    I do have the string, say temp ="271011240123456789232100"

    Then i have to do:
    Amount1 = temp / 97 The result must be 2793930310551100919918,5567010309278351

    Amount2 must be the decimals from amount1
    Amount2 = 0,5567010309278351

    Then amount3 = amount2 * 97 Result wil be 54

    Then 98 - amount3 (54) = 44
    (98 is a fix numer)

    44 then is the controlnumber

    How to do this in VB6

    Herman

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Calculating with very large numbers

    I don't think you can use VB6 with 271011240123456789232100 as it will overflow
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Calculating with very large numbers

    If you use a double it will not result in an overflow but I doubt that you will be able to get that level of precision on such a large number
    Always use [code][/code] tags when posting code.

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

Featured