Assuming the interest is annual
monthly interest rate = 7/100 = 0.07 /12 = 0.00583
Monthly payment (M) = P [i(1+i)^n] / [(1+i)^n-1]
where:
p= principal : 400,000
i= monthly interest rate = 0.00583
n= number of months required to pay the loan = 12 x 30 = 360
M = 400,000 [ 0.00583(1+0.00583)^360/ [(1+0.00583)^360-1
M = 400,000 [ 0.04726276/ 8.0598 ]
M = 2,345
Or using the table of mortgage
for 30 years 7% interest