What a appears as a series of digits maybe considered as a number or a character string of digits. Numbers are used in calculations and PDF forms have some strict requirements for this type of data. It can only consist of a sign, the digits 0-9, and a single decimal point. If it does not meet these standards, then the value is Not a Number (NAN) and cannot be used in a calculation.
Certain strings of numeric digits can be used in special text fields like the U.S. Social Security Number (SSN), time in one of many formats, U.S. Postal Zip Codes in 5 or 9 digit format. Numeric digits appearing in a field or variable are usually converted into the floating point format which is a a way to compactly store numeric data but unlike a string, it has no defined length unless forced to the string format using the String constrictor of string concatenation.
When accessing a field like the SSN that may have leading zeros, one needs to use the "valuesAsStirng" property and that property will convert the field value into a Sting type of value and that value will have a length. Note that the fields line SSN, Phone Number, Postal Zip Code, etc all have no separater characters in the stored value. You may find that even with the arbitrary mask you will need to use the "valueAsSting property for accessing the field.
Create a text field as above for a field named "Text1" and then run the following script in Acrobat's JavaScript console:
var nValue = this.getField("Text1").value;
console.println("Value: " + nValue + "/ntype of: " + typeof nValue);
var cValue = this.getField("Text1").valueAsString;
console.println("Value: " + cValue + "/ntype of: " + typeof cValue);
To see the differences in the two types of field properties.