0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-12 05:37:26 +08:00
discourse/plugins/discourse-subscriptions/assets
Régis Hanol 77cd806b81
FIX: Round dollar-to-cents conversion in subscription plans (#37877)
Setting a subscription price like $19.99 would fail with "Invalid
integer 1998.9999999999998" 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
2026-02-20 18:22:28 +01:00
..
javascripts/discourse FIX: Round dollar-to-cents conversion in subscription plans (#37877) 2026-02-20 18:22:28 +01:00
stylesheets DEV: Apply latest stylelint autofixes (#36294) 2025-11-27 18:07:22 +01:00