Rounding

  • Thread starter Thread starter b
  • Start date Start date
B

b

Hello all, we have a table that is part of our accounting package that
stores decimals as such: 123.45678.

However the reporting standards with the accounting system display that as
123.45 note that it does not round to the 123.46. I need for these reports
to match up however in my datagrid which i have set for currency it does the
rounding.. Does anyone know a way around this..
I Have looked around on the web but yet to find anything as of yet

Many TIA
 
Hi B,

I'm not sure which you are trying to manipulate, but if it's the accounting
package, find a way to add .5 to each amount automatically - it will then
round up and you wish. On the other hand, if you are trying to get the .net
datagrid to match, subtract .5 from each column - this is result in an
automatic round down, if you will.

HTH,

Bernie Yaeger
 
Check to make sure you do not have any areas where a datatype is a
double.

Is the reporting package for accounting in-house or are you able to
browse its source in any way? If not, you may want to look at creating
a SQL view that handles all of the rounding you may need to do on the
data side, then have the reporting package point to that view for its
data.

To keep things consistant you might want to have your application pull
from that view as well, just to simplify things in case future changes
need to be made.
 
b

Probably is this is banking rounding as is in version from Net 1.x
The behavior of this method follows IEEE Standard 754, section 4. This kind
of rounding is sometimes called rounding to nearest, or banker's rounding.

The Round function goes to the nearest integer, and if there are two nearest
integers then it goes to the even one. 1.5 rounds to 2, 0.5 rounds to 0.


I ask forever in these newsgroup who uses that.

In the Net 2.0 version will be more rounding methods possible.

I hope this gives an idea.

Cor
 
Back
Top