Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rounding Help Needed
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00861734
Message ID:
00861736
Views:
15
>I need to be able to round a dollar amount to the nearest $5.00 programmatically.
>
>for example($21.85 -> $20.00, $23.00 -> $25.00)

Try
yAmt = $21.85
? yAmt - (yAmt%10) + ;
	IIF((yAmt%10)>=$7.50, 10, ;
	IIF((yAmt%10)>=$2.50, 5, $0.00))
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform