(input, spec)
| 155 | |
| 156 | @staticmethod |
| 157 | def validate(input, spec): |
| 158 | if input: |
| 159 | try: |
| 160 | input = float(input) |
| 161 | except ValueError as e: |
| 162 | raise validation.ValidationError(len(input), six.text_type(e)) |
| 163 | |
| 164 | super(NumberReader, NumberReader).validate(input, spec) |
| 165 | |
| 166 | def _construct_template(self): |
| 167 | self.template = "{0} (float)" |