diff --git a/pvl/token.py b/pvl/token.py index 2f966b9..7478554 100644 --- a/pvl/token.py +++ b/pvl/token.py @@ -58,8 +58,8 @@ def __index__(self): try: return self.decoder.decode_non_decimal(str(self)) except ValueError: - if int(self) == float(self): - return int(self) + if int(str(self)) == float(str(self)): + return int(str(self)) raise ValueError(f"The {self:r} cannot be used as an index.")