VB6 Pmt() function

Is there an equivalent Xojo function for Pmt() from old VB6?

If not, then recommendations?

Seem like this might do it:

Public Function Pmt(amount As Double, monthlyInterestRate As Double, periods As Integer) as Double Dim payment As Double payment = amount / ((1 - (1 + monthlyInterestRate) ^ -periods) / monthlyInterestRate) Return payment End Function

Usage:

Dim payment As Double = Pmt(21000, 0.069 / 12, 48) ' payment = 501.90

Thanks Paul