diff --git a/src/qrules/particle.py b/src/qrules/particle.py index 175bdba0..cb382963 100644 --- a/src/qrules/particle.py +++ b/src/qrules/particle.py @@ -120,10 +120,9 @@ def _repr_pretty_(self, p: PrettyPrinter, _: bool) -> None: def _render_fraction(fraction: Fraction, plusminus: bool = False) -> str: - string_representation = str(fraction) if plusminus and fraction.numerator > 0: - return f"+{string_representation}" - return string_representation + return f"+{fraction}" + return str(fraction) def _to_parity(value: Parity | int) -> Parity: diff --git a/src/qrules/quantum_numbers.py b/src/qrules/quantum_numbers.py index cdf124fb..b3ce208c 100644 --- a/src/qrules/quantum_numbers.py +++ b/src/qrules/quantum_numbers.py @@ -58,10 +58,9 @@ def __repr__(self) -> str: def _float_as_signed_str(value: float, render_plus: bool = False) -> str: - string_representation = str(value) if value > 0 or render_plus: - return f"+{string_representation}" - return string_representation + return f"+{value}" + return str(value) @frozen(init=False)