// l = N(o.getMonthlyAmount(D), "en-US")
// where N = (e,t) => e.toLocaleString(t, {maximumFractionDigits:2})
// So for 19999/12 = 1666.5833..., l becomes "1,666.58"
if (l) {
const e = l.split("."); // ["1,666", "58"]
g = N(parseInt(e[0], 10)); // parseInt("1,666",10) === 1 → g = "1"
h = L(e[1]); // L("58") = "58"
}
// Rendered as $<g>.<h> → "$1.58"
To fix: split on the locale separator or do Math.floor(x) / Math.round((x%1)*100) to get your decimal instead.
🐞 bug report
Behavior:
What is the issue? (*)I am trying to set up an app for sale with enterprise/multisite tiers (my typical user has 500+ sites). But if any tier has an annual price with a comma ($1,000+), the React app that generates the upgrade interface chokes on the comma separator and outputs $1.58:
Versions: (*)
Freemius SDK Version:2.13.1WordPress Version:7.0PHP Version:8.4.18Plugin / Theme: (*)
Name:Editoria11ySlug:editoria11y-accessibility-checker (Freemius version still under development)Freemius ID:26217Problem code:
To fix: split on the locale separator or do Math.floor(x) / Math.round((x%1)*100) to get your decimal instead.