Format the value or raise a :exc:`ValidationError` if an error occurs.

def _validated(self, value):
        """Format the value or raise a :exc:`ValidationError` if an error occurs."""
        if value is None:
            return None
        try:
            return self._format_num(value)
        except (TypeError, ValueError):
            self.fail('invalid', input=value)
        except OverflowError:
            self.fail('too_large', input=value)