jpatokal / opal_or_not

Public transport fare comparison engine
http://opalornot.com
GNU Affero General Public License v3.0
18 stars 1 forks source link

Quarterly train ticket per week price calculation? #10

Closed subs0nic closed 10 years ago

subs0nic commented 10 years ago

The per week cost for a Quarterly ticket on Opal or Not comes out slightly higher than what I had in a spreadsheet that I made to compare prices a while back.

I noticed the per week price that Opal or Not returns seems to be based on dividing the Quarterly cost by 12 weeks to get the weekly cost, and not the more precise 12.86 weeks (or 12 weeks and 6 days) that the ticket lasts for. Was this intentional?

jpatokal commented 10 years ago

Ooh, good catch -- the code has the correct 90 days for a quarter, but it was truncating 90/7 to 12. Fixed.