You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry to revisit #6480 but I'm working with an API only Spree and just found it expects me to send the price in the locale format (so 1.0 with Spanish locale will be converted to 10 by Spree::LocalizedNumber), but will return it in the English format when I ask for it back ("1.0"), so I have to deal with the inconsistency, what do you think?
Expected Behavior
Send and receive numbers in a single format (ideally not localized)
Actual Behavior
I have to juggle numbering formats to talk to the API
Steps to Reproduce
Store is in Spanish
Create a product via /api/v1/products.json sending Float as String ("1.0")
Query API for product price and get "10.0"
Your Environment
spree_api 4.1.11
The text was updated successfully, but these errors were encountered:
Using <input type="number" step="0.01" /> on spree_backend may help users write numbers in their own locales and browsers would send consistent (aka English) formatting, so Spree::LocalizedNumber wouldn't be necessary. At least I tested it with Firefox in Spanish and it lets me use comma as decimal separator.
A friend made me notice I was sending HTTP params instead of JSON data so now I can send numbers instead of strings, but the offer to change input to numbers stands :)
Context
Sorry to revisit #6480 but I'm working with an API only Spree and just found it expects me to send the price in the locale format (so
1.0
with Spanish locale will be converted to10
bySpree::LocalizedNumber
), but will return it in the English format when I ask for it back ("1.0"
), so I have to deal with the inconsistency, what do you think?Expected Behavior
Send and receive numbers in a single format (ideally not localized)
Actual Behavior
I have to juggle numbering formats to talk to the API
Steps to Reproduce
"1.0"
)"10.0"
Your Environment
spree_api 4.1.11
The text was updated successfully, but these errors were encountered: