We want to use a number input field for prices, so it includes decimals like 18.00. That works fine, but as we're in Germany, we need a comma instead of a dot as decimal separator validated as correct. Is there any way to make that work?
Sure, we could use a text input field instead, but we want to make sure no text is entered.
Thanks for your help!
Hi,
Thank you for contacting us and I'd be happy to assist.
To achieve this formatting change for the output of number field values, you'll need a custom shortcode.
You'll find a good usage example with the code snippet for a similar requirement in this forum reply:
https://toolset.com/forums/topic/need-to-display-numeric-custom-field-in-european-decimal-format/#post-421274
I hope this helps and please let me know if you need further assistance.
regards,
Waqar
Hi Waqar,
I saw the options to manipulate the output. But as I said, it's about the input. Our customers are used to write numbers with comma as separator. So they probably will do during using the input in the WordPress-Admin.
How can I change the input-validation to comma as decimal separator instead of a dot?
Best,
Roland
Thank you for sharing this update.
I've performed some testing and research. I'm afraid, there is no built-in function available to replace the allowed decimal separator in the number type field.
We have an internal ticket to add this feature in future releases and I've added your voice to this matter too. But, with the pause on new features ( ref: https://toolset.com/2022/06/whats-next-for-toolset/ ), it wouldn't be possible to share how long it will take.
For now, a possible workaround is to add some custom script in the admin area, to apply custom masking/validation to a standard input field.
For more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/