I’m doing some simple calculations using numbers, but my numbers keep getting formatted as strings.
For example:
-
I’m sending a number using $_GET to my server action.
?checkout_id=69&unit_amount=101&tax_behavior=exclusive&tax_pct=21
-
It became a string
But I make it a numebr usingtoNumber()
-
I do a calculation with it and use
.formatNumber()
:
-
My number (price_excluding) is now a string again.
Does .formatNumber()
change my number to a string? Then it’s not a bug, just confusing.
Community Page
Last updated:
Last updated: