Jump to content
Macro Express Forums

Pulling My Hair Out Over "rounding"


IceBox

Recommended Posts

Hopefully someone can help me here. I have been having a very difficult time figuring out the logic used by Macro Express when rounding. I did read an article in this forum once, as well as the section of Joe's book that discusses "Banker's Rounding", but I don't think that's the issue in this case.

 

No matter what number I try, if I tell Macro Express to round a Decimal Variable to 2 places, it always rounds "5" down. So:

 

1.755 becomes 1.75 when it should be 1.76

1.765 becomes 1.76 when it should be 1.77 and so on and so on.

 

The only fix I have found is to add .00000001 to the number first, and then round, because, believe it or not.... 1.76500001 gets rounded to 1.77, but 1.765 does not.

 

Am I doing something wrong?

 

Thanks in advance for your help :)

Link to comment
Share on other sites

  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...