mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Handle null/undefined cases for price
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
angular.module("admin.utils").filter "unlocalizeCurrency", ()->
|
||||
# Convert string to number using injected currency configuration.
|
||||
(price) ->
|
||||
if (!price)
|
||||
return null
|
||||
# used decimal and thousands separators from currency configuration
|
||||
decimal_separator = I18n.toCurrency(.1, {precision: 1, unit: ''}).substring(1,2)
|
||||
thousands_separator = I18n.toCurrency(1000, {precision: 1, unit: ''}).substring(1,2)
|
||||
|
||||
Reference in New Issue
Block a user