#meteograms-metered-billing
1 messages · Page 1 of 1 (latest)
usage records are only integers so no decimals aren't supported.
But what is the use-case behind this? wondering if there's a different way to handle it
can you explain more?
Well there are lots of examples where decimal quantities are quite normal. Let's say I offer a subscription service to customers for the supply of sugar. A customer might consume 5kg of sugar one day, and 6.5kg the next. Or it could be 12.3 litres of beer. This would be handled quite nicely within a metered billing context, if it were possible to deal in decimal quantities. Don't see what the problem would be at the back-end because it's just summing numbers at the end of the day to work out how much the customer should be charged on a per-kg or per-litre price.
would it work if you create a Price with unit_amount_decimal and then your usage records end up being integers in grams or ml ?
Possibly. I'll try to get my head around that one.
Isn't the problem then that it's not counting in grams, but tens of grams (the price is adjusted by a factor of 100, not 1000), and it just becomes very confusing all round... not least for the customer. Easier just to allow decimal quantities?