Results 1 to 3 of 3

Thread: rounding up

  1. #1
    Join Date
    Jan 2004
    Posts
    1

    Unhappy Unanswered: rounding up

    Why does AccessXP round the number 2.5 to the number 2 instead of rounding it up to the number 3 ?

  2. #2
    Join Date
    Jan 2004
    Location
    Slovakia
    Posts
    32

    Re: rounding up

    Originally posted by TimothyWittnebe
    Why does AccessXP round the number 2.5 to the number 2 instead of rounding it up to the number 3 ?
    Because MS Access use rounding method called "Banker's rounding" in its round function. Take a look at:
    http://support.microsoft.com/default...b;en-us;196652
    and
    http://www.xbeat.net/vbspeed/c_Round.htm

  3. #3
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    VBScript's Round() function apparently has a serious flaw which of course Microsoft apparently considers a feature (called banker's rounding which has a bias toward evens) in that a 5 digit rounds up only if the digit to the left is an odd digit, if even it rounds down.

    Examples:
    0.5 -> 0
    1.5 -> 2
    2.5 -> 2
    3.5 -> 4
    4.5 -> 4
    5.5 -> 6
    6.5 -> 6
    7.5 -> 8
    8.5 -> 8
    9.5 -> 10
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •