|
-
May 7th, 2003, 05:41 AM
#1
Thread Starter
Registered User
Problem with rounding a number! [Resolved]
In real life, When we try to round a number, let say 3.825, up to 2 decimal points,
the answer is 3.83, right?
Unfortunately in VB .NET, the "Math.Round" method & "Decimal.Round" method,
round number like this (Read the remarks I quote from the Help file ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemDecimalClassRoundTopic.htm):
"When d is exactly halfway between two rounded values, the result is the rounded value that has an even digit in the far right decimal position. For example, when rounded to two decimals, the value 2.345 becomes 2.34 and the value 2.355 becomes 2.36. This process is known as rounding toward even, or rounding to nearest."
So my question is how can be avoid this type of rounding method. Is there anyway or any method that enables us to round number like in the real life?
Please guide. Thank you.
Last edited by albertlse; Aug 21st, 2003 at 08:30 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|