Link to home
Start Free TrialLog in
Avatar of RETAILREALM
RETAILREALMFlag for United States of America

asked on

Apply Rounding Rules

Hi,
I want perform price rounding operation as follows

1. When Price > 0 and Price < 500 make it multiple of 10
2. When Price > 0 and Price < 500 end price with 1.1
3. When Price > 0 and Price < 500 make it multiple of 10 and end with 1.1

It can be to round to nearest, round up or round down operation,

For eg.
With 3 rd point operation round to nearest--> I should get -->
Old Value      Round to near                   Round Up                                  Round Down
-8.00                -8.00                                 -8.00                                   -8.00
0.00                  0.00                                   0.00                                   0.00
0.50                11.01                                  11.01                                  1.01
5.00                11.01                                  11.01                                  1.01
12.99              11.01                                  21.01                                  1.01
79.99              81.01                                101.01                                 69.01

Please provide some hints, formulas. with sql or vb 6 program

Avatar of fds_fatboy
fds_fatboy

Can you rephrase the question for the hard of thinking.

Conditions 1, 2 and 3 are all the same. i.e. When Price > 0 and Price < 500

Youer examples do not tally with statements 1, 2 or 3.
ASKER CERTIFIED SOLUTION
Avatar of PaulCaswell
PaulCaswell
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial