Returns a number with its value represented by var. :param var: Variable that may represent a number. :type var: str, sympy object, int, float :return: Rational number :rtype: sympy.rational
(var)
| 526 | return result |
| 527 | |
| 528 | def _checkNumber(var): |
| 529 | """ |
| 530 | Returns a number with its value represented by var. |
| 531 | |
| 532 | :param var: Variable that may represent a number. |
| 533 | :type var: str, sympy object, int, float |
| 534 | |
| 535 | :return: Rational number |
| 536 | :rtype: sympy.rational |
| 537 | """ |
| 538 | if type(var) == str: |
| 539 | var = _replaceScaleFactors(var) |
| 540 | else: |
| 541 | var = str(var) |
| 542 | try: |
| 543 | var = sp.Rational(var) |
| 544 | except BaseException: |
| 545 | var = None |
| 546 | return var |
| 547 | |
| 548 | def str2number(var): |
| 549 | """ |
no test coverage detected