MCPcopy
hub / github.com/jwngr/sdow / with_commas

Function with_commas

scripts/generate_updated_wikipedia_facts.py:13–15  ·  view source on GitHub ↗

Formats the provided number with commas if it is has more than four digits.

(val)

Source from the content-addressed store, hash-verified

11
12
13def with_commas(val):
14 """Formats the provided number with commas if it is has more than four digits."""
15 return '{:,}'.format(int(val))
16
17
18def get_percent_of_pages(val, decimal_places_count=2):

Calls

no outgoing calls

Tested by

no test coverage detected