Results 1 to 3 of 3

Thread: Hundredth rounding in Euro Conversion

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 1999
    Posts
    8
    Using Double variable to store numbers from math formulas, I'm not able to get the correct rounding from national currency to EURO. That is, when the result is, for instance, 37.42500 I should have my variable (formatted with ##0.00) equals to 37.43 . Instead, I get 37.42 that is wrong up to conversion rules defined by international laws.
    If the number is 37.43500 I get the correct 37.44 as expected.
    Using the same variable defined as Currency I get the correct result.
    Does this mean that I cannot rely on variables defined Double to get the correct result (or even to get always the same rounding !)?
    Thanks in advance
    Ramel

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    I believe that (at least) in the United States, a "5" that follows an even number will be rounded down and a "5" that follows an odd number will be rounded up. Is that different from "conversion rules defined by international laws"?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 1999
    Posts
    8
    the rule is very simple:
    all the numbers from .005 on must be rounded upwards to the next hudredth. The numberst up to .004999999999999999 must be rounded downwards to the actual hundredth.
    Ramel

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