Skip Navigation

[Closed] Number input field with comma as decimal separator

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 1 year, 1 month ago.

Assisted by: Waqar.

Author
Posts
#2656345

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!

#2656669

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

#2656701

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

#2657191

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/

The topic ‘[Closed] Number input field with comma as decimal separator’ is closed to new replies.