main ← fix/subscription-price-floating-point
opened 11:10AM - 17 Feb 26 UTC
Setting a subscription price like $19.99 would fail with "Invalid integer 1998.9…999999999998" from the Stripe API.
Due to IEEE-754 floating point arithmetic, `parseFloat("19.99") * 100` produces `1998.9999999999998` instead of `1999`. This non-integer value is then sent directly to Stripe which rejects it.
Wrapping the multiplication in `Math.round()` ensures the result is always a proper integer before being stored as `unit_amount`.
https://meta.discourse.org/t/393466