Streaming live at 10am (PST)

Number fields adding decimal points


Number fields for weights in my “Products” collection are spontaneously updating to have more decimal places than I entered, which changes the weight and subsequently shipping costs of products in customers’ carts.

I had this issue before and thought it was solved by entering no more than the number of decimal points specified in the collection template but it’s reared its head again and I can’t see why.

Anyone see what is causing this? Seems like a pretty drastic response from the CMS and causes a lot of unwanted effects.

Here is my public share link:

Yeah that’s a very well-known JavaScript bug.

Stuff like this can happen: 0.1 + 0.2 -> 0.30000000000000004


Is floating point math broken?

How to deal with floating point number precision in JavaScript?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.