Server side formatting as number not working as expected

I’m doing some simple calculations using numbers, but my numbers keep getting formatted as strings.

For example:

  1. I’m sending a number using $_GET to my server action. ?checkout_id=69&unit_amount=101&tax_behavior=exclusive&tax_pct=21

  2. It became a string
    image
    But I make it a numebr using toNumber() image

  3. I do a calculation with it and use .formatNumber():
    image

  4. My number (price_excluding) is now a string again. image

Does .formatNumber() change my number to a string? Then it’s not a bug, just confusing.

Community Page
Last updated: