Add scales (not the reptile kind) to double/float validations
-------------------------------------------------------------

                 Key: VALIDATOR-238
                 URL: https://issues.apache.org/jira/browse/VALIDATOR-238
             Project: Commons Validator
          Issue Type: Improvement
    Affects Versions: 1.3.1 Release
            Reporter: Paul Benedict


I have a DECIMAL(10, 8) column that I am trying to capture as user input.  This 
is very hard to represent with the validator because the length of the scale is 
very large. I am currently using a maxlength=8,min=0,max=99999999 but it is not 
exact.

I propose retrofitting double/float validations that may include length of the 
scale. For another example, with a scale of two, a user may enter 2, 2.5, 2.55 
but not 2.555. This will allow me to remove any inexact usage of maxlength.

<field property="latitude" depends="double,doubleRange">
  <var>
    <var-name>scale</var-name>
    <var-value>8</var-value>
  </var>
  <var>
    <var-name>min</var-name>
    <var-value>-90</var-value>
  </var>
  <var>
    <var-name>max</var-name>
    <var-value>90</var-value>
  </var>
</field>





-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to