roskakori / cutplace

validate data stored in CSV, PRN, ODS or Excel files
http://cutplace.readthedocs.org/
GNU Lesser General Public License v3.0
18 stars 20 forks source link

Reject all invalid decimal values #109

Open roskakori opened 9 years ago

roskakori commented 9 years ago

Goal: decimal values with too many digits after the decimal separator are rejected

Examples:

>>> from cutplace import ranges
>>> size_range = ranges.DecimalRange('0...299.99')
>>> size_range.validate('size', '0') # ok
>>> size_range.validate('size', '299.99')  # ok
>>> size_range.validate('size', '299.901')  # FIXME: should cause cutplace.errors.RangeValueError