foodcoopsat / foodsoft_hackathon

Other
1 stars 2 forks source link

Localize numbers in article CSV download (decimal comma vs. point) #82

Open twothreenine opened 2 months ago

twothreenine commented 2 months ago

So far (in upstream as well), numbers like prices etc. are not localized in the exported article CSV. Therefore, you have to select an English locale when opening the CSV in a spreadsheet editor, or else they won't be recognized as numbers.

Fix example: number_with_precision(article.minimum_order_quantity, strip_insignificant_zeros: true) etc. in https://github.com/foodcoopsat/foodsoft_hackathon/blob/5be0082171f026d289cb43368cc42756637660d0/app/lib/articles_csv.rb#L30-L47 (beware this also limits numbers to 3 decimals, I couldn't find a number i18n method which does just that)

Depends on #81.