Hello!
So when somebody type a dot in an input field you want to change it for a comma? Or in which kind of field do you want to do this change?
Regards!
Thread Starter
uuups
(@uuups)
Hello, i want to use calculted fields in smart forms on a Website used mostly in Germany. In Germany you don`t fill in “3.5”. You will fill in “3,5”. Wenn I do this on my testside it counts for example “3,5×2=0”. With point between 3 and 5 it works. But I need the Comma for separation
Best regards
Ah got it, the formula is kind of complex (sorry) but try something like this:
String(
String($$field_rnField1$$).replace(/,/g,’.’)*String($$field_rnField2$$).replace(/,/g, ‘.’)
).replace(/\./g,’,’)
Replace rnField1 and rnField2 for your field ids
What the formula does is this:
1.-Convert temporally your input field commas to dots so they can be used in arithmetical operations.
2.- Transform the result dots to commas so the result is properly shown in the format that you need.
Hope this helps but if it doesn’t please let me know!
Thread Starter
uuups
(@uuups)
Hello i tried this, unfortunately after implementation of the String the total field says without or with typing a number or a number with comma or dot “undefined”. Here is al link to the dummy site.
http://willinger-willinger.de/wp-multiwilly/andi-gold/undefined/
Hello!
The formula doesn’t seems to be valid:
This is the formula that the form is using:
“String(n String([field rnField1]).replace(/,/g,’.’)*String([field rnField2]).replace(/,/g, ‘.’)n).replace(/./g,’,’)”
the letter ‘n’ in (n and n) is not valid and is making the formula not work, could you fix it please? Removing those ‘n’ should fix it.
Regards!
Thread Starter
uuups
(@uuups)
Thank you very much for the fast and high qualified support! It works very well now!
Best regards – willy