Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where should ROUND() be applied in complex calc
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01396309
Message ID:
01396317
Views:
65
>See if this help
>FLOOR( ) Function
>CEILING( ) Function


Thanks Valdimir, but no they won't help. I will have to use ROUND(). My bad I have not been able to explain better, but I want to put the ROUND(xxx.xxx, 0) calls to these values, but should I put for each and every place I do a calculation or only ROUND() for strategic calculations, if which are considered strategic?

>>Hi all
>>
>>There are some complex tax calculations to be performed. For eg. Excise is calculated on an abatement provided value of the Maximum Retail Price (MRP) of a products. Two more taxes are then calculated on this Excise amount. Assuming the client is going to ROUND() at 0 precision - no decimal places.
>>
>>Qty * MRP = Amount
>>3 * 560.1257 = 1680.3771
>>
>>Amount - Abatement % = Assessable Value
>>1680.3771 - (1680.3771 * 25 / 100) = 1260.282825
>>
>>% of Assessable Value = Excise
>>1260.282825 * 4 / 100 = 50.411313
>>
>>% of Excise = Education Cess
>>50.411313 * 2 / 100 = 1.00822626
>>
>>% of Excise = S&H Education Cess
>>50.411313 * 1 / 100 = 0.50411313
>>
>>Assessable Value + Excise + Edu. + S&H = still more taxes to be added :)
>>1260.282825 + 50.411313 + 1.00822626 + 0.50411313 = 1,312.20647739
>>
>>Except Qty and MRP, where is it mathematically suggest (if I may say so) that ROUND() be applied so that decimals are removed and set to the nearest integer
>>
>>Please advise.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform