4 ms·
He gave good reasons why they used millicents, one of the best reasons was that it prevents things like a customer owing $0.006 and therefore getting a "past du
by EdwardCoffin 13y ago
He gave good reasons why they used millicents, one of the best reasons was that it prevents things like a customer owing $0.006 and therefore getting a "past due" bill for $0.00. Another was that it prevents real errors from hiding as possible round-off errors. I found the reasoning convincing myself, and yes, I have worked in the financial industry.
- gizmo 13y agoI agree that using regular floats for money is insanity. Aside from that I'm not convinced at all, because the situation never arises where you want to charge people 0.01 cents or 17c for that matter. Who in their right mind is going to generate an invoice for 17 cents? If people have a small amount of credit just give them an extra day of service. If they have a small negative credit either ignore it or subtract one day the next time they renew. If there is a case for using milicents I sure haven't seen it.
- beagle3 13y agoAd impressions are priced at e.g. 0.40 USD per thousand impressions - that is, 40 millicent. Personally, I prefer to think of that as 400 microdollars, but to each their own.
- dmethvin 13y agoAs I understood it, the basis for their system was that each customer's account contains the actual current balance (remaining value) at any point (any given day). If you charge $10/year for a service that's 2.739726027 cents per day. You can't have a system like that and round to pennies without some serious error at the end of a year. I'm not sure I understand the value of a system like that though. In the systems I've used and built, most customers see their service as an annual thing that renews on a particular date every year, for which they pay an annual fee. Doing it as a daily fee simplifies the special cases like converting between plans but makes it harder to deal with "your annual plan always renews on this date".
- EdwardCoffin 13y agoThe way I understood it is they chose the resolution of millicents because it was precise enough to allow an annual plan that was never converted to have this behaviour, yet be cleanly convertible.
- lambda 13y agoBecause if you do all of your internal calculations in cents, then the rounding errors add up to a significant amount in not very much time. Let's say you have a service that is $20 per year. That is 5.475¢ per day (I'm assuming a year of 365.242 days; if you do an integral number of days and account for leap years, then it will be a different daily rate in regular years and leap years). If you are doing calculations which pro-rate certain things per day, such as allowing people to transition between different subscription types while applying their existing balance to the new subscription, and you rounded that down to 5¢ per day, then when you multiplied that back out to a year it would only be $18.26 per year, not $20 per year. That's a pretty substantial difference. Where you fix your precision depends on how much error you're willing to deal with. In the article, he describes how using millicents leads to an error of 165m¢ (.165¢) per year, if you apply the rounded daily rate and multiply by the number of days, which is deemed acceptable for their purposes. For a much more extreme example of precision, Tarsnap quotes their prices in picodollars per byte per month (https://www.tarsnap.com/picoUSD-why.html https://www.tarsnap.com/picoUSD-why.html) and performs all calculations in attodollars per byte per day.