#703 房貸購買試算

HaoHao
HaoHao
Aug 25, 2017 · 2 min read

由於看到同學們有在寫股票App及保險App,給了我靈感,就做了一個房貸試算App。內容尚未美化…就先將就囉

— — — — — — — — — — — — — — — — — — — — -

經過幾堂課的洗禮,把segue的元件加入
畫面多了一個選項,可以計算每坪單價。畫面一樣沒有美觀

房貸的計算公式小弟是參考土地銀行的試算方式做出來的,月繳金額不會差太多,但利息總額會有落差(可能每家銀行的算法不太相同)。

//試算公式:
//每月應付本息金額之平均攤還率
//={[(1+月利率)^月數]×月利率}÷{[(1+月利率)^月數]-1}
//(公式中:月利率 = 年利率/12 ; 月數=貸款年期 x 12)

光是這條公式要寫成程式就花了我不少時間….

程式設定預設是頭期款2成的貸款,薪水以雙薪不超過1/3為主,若超過就會像圖片這樣,目前發現的Bug是利率的部分輸入文字會閃退(小弟只有控制輸入空白會出現錯誤,但若出現字串一樣閃退)

— — — — — — — — — — — — — — — —
程式已加入貸款成數的選項, 還是要以打字的方式完成

https://github.com/h07870005/houseapp.git

彼得潘的 Swift iOS App 開發教室

學習 Swift iOS App 開發的學生作品集

)

    HaoHao

    Written by

    HaoHao

    彼得潘的 Swift iOS App 開發教室

    學習 Swift iOS App 開發的學生作品集

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade