Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Rounding

Author  Topic 

Jonah
Starting Member

3 Posts

Posted - 2001-11-23 : 06:50:45
We have a rating system, in SQLServer 7, that uses Rate*Duration (money * float) to obtain an amount. This amount is then stored in a money field in a table, which is rounded to 4 decimal places.
so e.g. If the amount was calculated as 3.5549467 the amount stored in the money field would be 3.5549, it rounds up or down on the fifth digit
Our users are a bit fussy and are wanting the rounding to start from the last decimal digit working forwards.
e.g. "3.5549467 must be 3.5550 here is why
3.5549467 ->3.554947 -> 3.55495 -> 3.5550"

Any ideas how to do this ?

We have a possible solution which uses round(round(round(round...
but this depends on knowing the total number of decimal digits. We could use a loop of some sorts but this could adversly effect performance as we are talking around 4 million records a month


   

- Advertisement -