Skip to content

Commit 5ef0dd5

Browse files
Add regression test for pylint-dev#8109
1 parent a0b28f9 commit 5ef0dd5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
# pylint: disable=missing-docstring
3+
4+
5+
from dataclasses import dataclass
6+
@dataclass
7+
class Number:
8+
amount: int | float
9+
round: int = 2
10+
11+
def __str__(self):
12+
number_format = "{:,.%sf}" % self.round
13+
return number_format.format(self.amount).rstrip("0").rstrip(".")

0 commit comments

Comments
 (0)