| 3621 | return int(convertedNumber) |
| 3622 | |
| 3623 | def parse_to_numeric(self, number): |
| 3624 | stringVersion = self.number_to_string(number) # self will convert 1.0 and 1 to "1" and 1.1 to "1.1" |
| 3625 | # keep self in mind: |
| 3626 | # in JS: 1 == 1.0 is True |
| 3627 | # in Python: 1 == 1.0 is True |
| 3628 | # in PHP: 1 == 1.0 is True, but 1 == 1.0 is False. |
| 3629 | if stringVersion.find('.') >= 0: |
| 3630 | return float(stringVersion) |
| 3631 | return int(stringVersion) |
| 3632 | |
| 3633 | def is_round_number(self, value: float): |
| 3634 | # self method is similar to isInteger, but self is more loyal and does not check for types. |