Price Field Options garbled upon edit with German money format
If you set (civicrm/admin/setting/localization) the thousands separator to '.' and the decimal to ',' as it's commonly used in Germany, editing price sets goes horribly wrong: If you have a price field with options, and you want to edit the options, the amount, let's say 169.00
, is given as 169.000000000
. If you save the form without changing the value, this gets interpreted as "1.000.000.000,00", which then gets even worse when you edit the field again.
The whole issue seems to go back to an unfortunate combination of the CRM_Utils_Money::format()
function with German localisation, and the underlying DB field civicrm_price_field_value.amount
having type decimal(18,9)
- yes, nine decimals.
Observed on CiviCRM 5.3.2
.