Skip Navigation

[Résolu] Use comma in numberfield in wp-admin

This support ticket is created Il y a 2 années et 3 mois. There's a good chance that you are reading advice that it now obsolete.

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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par martijnH Il y a 2 années et 3 mois.

Auteur
Publications
#2436559

We have a weird situation. And I don't know how this happened.
We had a custom field which was a number type.
And for some reason the dot didn't work and comma's did.
Yesterday out of nowhere comma's stopped working after almost a year, aside from updates nothing changed on the website.

My questions:

1) What is the default decimal character in toolset dot or comma?
2) Can this be changed? if so, how/where?
3) Does the situation I describe above sound familiar?

#2436639

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi there

Types numeric fields use decimal points rather than commas.

The validation comes from the jQuery validation plugin (lien caché).

Types doesn't modify the default numeric validation in any way, so I don't think changes in the behaviour (going from dots to commas and back again) would reflect changes in Types; it may have occured because of some interaction with code from another plugin.

To change the behaviour you would need to enqueue custom JS on the admin pages that modified the jQuery validation options, bearing in mind this could have consequences if you intended to do anything with these numeric fields other than display them (e.g. use them in queries where a particular format was expected).

Although other users have requested the possibility to use commas instead of dots I haven't come across anything like you describe.

#2438689

Thank you for the detailed explanation. I know enough. We will convert all fields to the dot.