Hello,
A number field shows a comma (,) decimal point, but actually stores a dot (.) decimal point, this is how it looks in the panel
If I use a dot instead of a comma, save and reload, the comma appears again.
This is the number field code:
price:
label: Price
type: number
step: ,01
width: 1/3
placeholder: 0,00
after: €
I’ve set my locale in the config:
'locale' => [
LC_ALL => 'es_ES.utf8',
],
This is the output of <?php dump(localeconv()) ?>
Array
(
[decimal_point] => ,
[thousands_sep] => .
[int_curr_symbol] => EUR
[currency_symbol] => €
[mon_decimal_point] => ,
[mon_thousands_sep] => .
[positive_sign] =>
[negative_sign] => -
[int_frac_digits] => 2
[frac_digits] => 2
[p_cs_precedes] => 0
[p_sep_by_space] => 1
[n_cs_precedes] => 0
[n_sep_by_space] => 1
[p_sign_posn] => 1
[n_sign_posn] => 1
[grouping] => Array
(
[0] => 3
[1] => 3
)
[mon_grouping] => Array
(
[0] => 3
[1] => 3
)
)
So, how do I get a comma in the content file, so when I echo the product’s price, I also get a comma instead of a dot ?
Interestingly if I change LC_ALL the output of localeconv() also changes, BUT it does not seem to change the behaviour of the number field in the panel. Even if I use LC_ALL => 'en_GB.utf8',
the number field insists on using a comma.
Which leads me to believe this is governed by something else than localeconv() ?
Thank you