diff --git a/src/api/res.py b/src/api/res.py index 9cf95960..e2021db5 100644 --- a/src/api/res.py +++ b/src/api/res.py @@ -90,6 +90,16 @@ def res( "Please choose one or the other." ) + if sigfigs is not None and isinstance(value, str): + raise ValueError( + "You can't set sigfigs and supply an exact value. Please do one or the other." + ) + + if decimal_places is not None and isinstance(value, str): + raise ValueError( + "You can't set decimal places and supply an exact value. Please do one or the other." + ) + # Parse user input name_res = parsers.parse_name(name) value_res = parsers.parse_value(value) diff --git a/src/application/rounder.py b/src/application/rounder.py index 7c1847ae..a8cc168f 100644 --- a/src/application/rounder.py +++ b/src/application/rounder.py @@ -58,8 +58,6 @@ def round_result(cls, result: Result, config: RoundingConfig) -> None: 8. Is fallback for decimal places given (not -1) (see config)? Round value according to number of decimal places. - - TODO: Warning message if user specifies exact value and sigfigs etc. """ cls._round_result(result, config)