Round up to next $25 increment

AccessWimp

New member
Local time
Today, 14:52
Joined
May 11, 2005
Messages
7
Hi,

Need a little help with rounding up. In A2K I have a form with a textbox that displays a security deposit. Security deposit is calculated by rounding the payment to the next $25 increment, hence a payment of 324.53 should have a security deposity of $325.00, but a payment of $325.01 should have a security deposit of $350.00. The code I am using for a datasource for txtSecurity deposit usually works correctly, but for this payment ($324.53) it rounds to $350.00. Here is the code..

=(([txtPayment]\25)*25+[txtSecDepRndTo])

txtSecDepRndTo holds the $25 incremental value.

Incidentally, if the payment is $324.49 my code rounds the Security Deposit to $325.00 as it should.

Any help would be greatly appreciated.
 
This is right off the top of my head...

=IIF(25 Mod txtPayment > 0, txtPayment + (25 - 25 Mod txtPayment), txtPayment)

Apologies if it isn't what you need.
 
heres a trick, multiply by 4 and round to nearest 100, then devide by 4.
 
Alternatively, you can create a custom rounding function, to use like you would Round(). See here for an example. You can find multiple examples on this forum as well.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom