diff options
Diffstat (limited to 'pint/facets/measurement/objects.py')
-rw-r--r-- | pint/facets/measurement/objects.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pint/facets/measurement/objects.py b/pint/facets/measurement/objects.py index 0fed93f..6fa860c 100644 --- a/pint/facets/measurement/objects.py +++ b/pint/facets/measurement/objects.py @@ -23,7 +23,7 @@ class MeasurementQuantity: def plus_minus(self, error, relative=False): if isinstance(error, self.__class__): if relative: - raise ValueError("{} is not a valid relative error.".format(error)) + raise ValueError(f"{error} is not a valid relative error.") error = error.to(self._units).magnitude else: if relative: @@ -98,7 +98,7 @@ class Measurement(PlainQuantity): ) def __str__(self): - return "{}".format(self) + return f"{self}" def __format__(self, spec): spec = spec or self.default_format @@ -133,7 +133,7 @@ class Measurement(PlainQuantity): # scientific notation ('e' or 'E' and sometimes 'g' or 'G'). mstr = mstr.replace("(", "").replace(")", " ") ustr = siunitx_format_unit(self.units._units, self._REGISTRY) - return r"\SI%s{%s}{%s}" % (opts, mstr, ustr) + return r"\SI{}{{{}}}{{{}}}".format(opts, mstr, ustr) # standard cases if "L" in spec: |