Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I ran into issues coding an interest calculator for personal usage when I realized that the length of a year is variable. My unit tests were failing because all the finance examples never explained how they dealt with time changing out from under the formulas they were using, and all the computer knew was Unix time.

I still don't exactly know how to handle this. If you start an account that compounds interest continuously, does the daily interest rate change if one year is longer than another?



In the kind of finance where you’re dealing with interest payments, you choose/agree on/accept a day count convention and run with it.

https://www.investopedia.com/terms/d/daycount.asp




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: