# division on vba with formating

1. Competent Performer
Windows 7 32bit Access 2007
Join Date
Aug 2013
Posts
131

## division on vba with formating

i have 4 fields. 1. Principle 2. IntRate 3. days 4. IntPerDay. I have to find interest per day and total interest

Me.IntPerDay.Value = Nz([Principle], 0) * Nz([IntRate], 0) / 36500 for per day interest

and

Me.Interest_Debit.Value = [Days] * [IntPerDay] for total interest

suppose i have principle amount 123.32 and interest rate 12.33 and day 5

then

i got

Interest per day = 0.0416 and
total interest = 0.2082

but i want

Interest per day = 0.04 and
total interest = 0.20

can it is possible.

2. Wrap your expression in the Round Function

http://www.techonthenet.com/access/f...eric/round.php

3. VIP
Windows XP Access 2007
Join Date
Jun 2012
Posts
3,904
total interest = 0.2082
...
total interest = 0.20
Do you really want .2082 to round down to .20, or should it round to .21?

4. VIP
Windows 7 32bit Access 2010 32bit
Join Date
May 2013
Location
Dallas TX
Posts
1,742
If this is real money, you'd be legally safer by keeping the decimals in the daily rate and rounding or truncating the end total. When I did this kind of thing, the standard was to truncate to .20 and retain the .0082 in unpaid interest differential in a different field, to add to the result next time.

5. Competent Performer
Windows 7 32bit Access 2007
Join Date
Aug 2013
Posts
131
i want round in daily interest amount Rs.0.04 and then multiply with day and result should come Rs. 0.20

6. VIP
Windows XP Access 2007
Join Date
Jun 2012
Posts
3,904
I see, so it looks like you want to apply the rounding to the factor before the multiplication.
Just apply the ROUND function to that part of your formula before multiplying (see Alan's post/reference on rounding), i.e.
Code:
`Me.Interest_Debit.Value = [Days] * Round([IntPerDay],2)`

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Other Forums: Microsoft Office Forums