MCPcopy
hub / github.com/tornadoweb/tornado / friendly_number

Method friendly_number

tornado/locale.py:473–482  ·  view source on GitHub ↗

Returns a comma-separated number for the given integer.

(self, value: int)

Source from the content-addressed store, hash-verified

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
485class CSVLocale(Locale):

Callers 1

test_friendly_numberMethod · 0.80

Calls 2

appendMethod · 0.80
joinMethod · 0.80

Tested by 1

test_friendly_numberMethod · 0.64