If you are interested in manually calculating an interest amount, you need to understand the impact of a stub period or an irregular payment. When you have monthly compounding or a monthly rate period, i.e. a mortgage or auto loan, the interest calculation is based on the principal times the interest rate divided by 1/12th assuming the payments are all made timely month to month.
So what is the calculation for interest if they are monthly compounding or rate period and the payment is in 45 days? You actually will have a hybrid calculation. To calculate the interest, you will count one full month and then do an exact day calculation for the remaining days. To determining the number of days, you always count backwards. So if the payment is made on June 15 and the last payment was on May 1st, you would count one month from June 15th to May 15th and then count the number of days from May 15th to May 1st or 14 days. The exact day portion of the calculation would be the principal times the interest rate times the number of days and divided by probably 365. Another twist to this calculation is if you have compound interest. When you have a stub period, you would have to add the unpaid interest to the principal before doing the second part of the hybrid calculation. The calculation can be tricky but doable.
The algorithms in TValue software do all of these calculations for you. Simply put in the appropriate rates, dates, and amounts and TValue will do the proper interest calculations and amortize the loan appropriately.