Hello,
Can someone please suggest what would be the regular expression for a decimal with a precision of 3? I have tried following but does not do anything.
var regExpDec = / ^ ([0-9]{0,3})+(\.[0-9]{1,3})?$/ ;
var vMatched = this.rawValue.match(regExpDec);
this.rawValue =null ;
xfa.host.messageBox("Enter the following format:999.999", 3, 0);
xfa.host.setFocus( this );
}
I have Pattern set for Display, Edit and Validation as num{zzz9.zzz}. Do I still need to Limit Leadiing Digits and Tailing Digits on the Object properties?
I need to be able to enter following :
["123.123", "2", "56754", "292.123", "0.21", "3.1"]
Thank you.
if
Views
Replies
Total Likes
I have tried following and nothing is working. Any suggestions?
//var regExpDec = /^([0-9])+(\.[0-9]{1,3})?$/;
//var regExpDec = /^\d*[0-9](\.\d*[0-9])?$/;
//last var regExpDec = /^([0-9]{3})+(\.[0-9]{3})?$/;
//var regExpDec = /^\d+(\.\d{0,2})?$/ ;
//var regExpDec = /^\d[0-9]+\.\d{0,3}?$/$
//var regExpDec = /^\d{1,3}+([.]\d{1,3})?$/;
Views
Replies
Total Likes
Did you try placing a decimal button on the form and set the Trailing digits to 3.
And in the display pattern you can choose which pattern is appropriate for you. In the existing patterns you will see two digits after the decimal you can manually add an extra digit after the decimal.
For example: num{(zzzz9.999)}
Hope this give some ideas for your issue..
Thanks
Srini
Views
Replies
Total Likes
Thank you for the reply.
The field is decimal field and Pattern is set to following format on Display and Edit as num{zzz9,zzz}.
My client wants to see error message in case they enter wrong format. So, when they exit the field, if the number is different then for an example 1.234 or 0.234 or 122.677...the message error will pop up teling them what the right formt is.
THank you,
Views
Replies
Total Likes
Does anyone know why thsi pattern would not work in my case where I want decimal field to look like 999.999É
Title | Test Details Pattern Title |
---|---|
Expression | ^\d{1,3}(\.\d{1,3})?$ |
Description | validate a number 5 digits and 2 decimal places allowing zero |
Matches | 12345.67 | 0 | 0.1 |
Non-Matches | 123456.78 | 123456.789 | .1 |
Views
Replies
Total Likes
Here is the solution. I've changed decimal field to text field and placed following code on exit.
var regExpDec = /^\d{0,3}\.\d{0,3}$/ ;
var vMatched = this.rawValue.match(regExpDec);
this.rawValue
= null;
xfa.host.messageBox("Enter the following format : 999.999" ,"CAS No.", 3, 0);
xfa.host.setFocus( this);
}
Views
Replies
Total Likes
Views
Likes
Replies