Validation: validCurrency => singe digit wasn't allowed

Hi dhtmlx-Team,

i noticed that when i applied the ValidCurrency validation rule to a form that i can enter values like:
04, 14, 24
4.5 and 4,5
but NOT: 4
A single digit value was not allowed, which doesn’t seem right.

greetings,
Björn

Hi

thanks we will fix if in future update,
for now you can use:

dhtmlxValidatuion.isValidCurrency=function(value) { return value.toString().match(/^\$?\s?\d+?([\.,\,]?\d+)?\s?\$?$/) && true || false; }

Hi Andrei,

thank you very much for your reply.
There was a small typo in your code. :wink:
If someone want to use it, here without typo.

dhtmlxValidation.isValidCurrency=function(value) { return value.toString().match(/^\$?\s?\d+?([\.,\,]?\d+)?\s?\$?$/) && true || false; };

Congrats!

You have passed the test :sunglasses: