Returns a comma-separated number for the given integer.
(self, value: int)
| 471 | } |
| 472 | |
| 473 | def friendly_number(self, value: int) -> str: |
| 474 | """Returns a comma-separated number for the given integer.""" |
| 475 | if self.code not in ("en", "en_US"): |
| 476 | return str(value) |
| 477 | s = str(value) |
| 478 | parts = [] |
| 479 | while s: |
| 480 | parts.append(s[-3:]) |
| 481 | s = s[:-3] |
| 482 | return ",".join(reversed(parts)) |
| 483 | |
| 484 | |
| 485 | class CSVLocale(Locale): |