How house affordability is calculated
Take the smaller housing budget allowed by your two editable income ratios. Subtract property costs, then convert the remaining principal-and-interest payment into a loan balance. Add the down payment; keep closing costs outside it.
Worked example
At $10,000 monthly income, a 30% housing cap, no other debt, $500 monthly carrying costs, 0% interest and ten years, $2,500 per month supports $300,000 borrowed. A $20,000 down payment gives a $320,000 budget.
With the default inputs — $8,000 income, 28% and 36% caps, $500 other debt and $600 carrying costs — the housing budget is min($2,240, $2,380) = $2,240, leaving $1,640 for principal and interest. At 6.5% for 30 years each borrowed dollar costs $0.00632068 a month, so $1,640 supports $259,466; with $60,000 down the budget is about $319,466.