blob: 69af0356a01244d721ab247acc038fedab8b38b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
"""Regression test for https://github.com/pylint-dev/pylint/issues/8109."""
# pylint: disable=missing-docstring, unsupported-binary-operation
from dataclasses import dataclass
@dataclass
class Number:
amount: int | float
round: int = 2
def __str__(self):
number_format = "{:,.%sf}" % self.round # [consider-using-f-string]
return number_format.format(self.amount).rstrip("0").rstrip(".")
|