Commas in numbers!

This commit is contained in:
Dan Helfman 2021-10-07 10:26:16 -07:00
parent cdb9187809
commit 7a025bb18d
1 changed files with 4 additions and 4 deletions

View File

@ -73,7 +73,7 @@ def main():
chapter_status = status_by_chapter.get(chapter_number)
print(
'chapter {}: {} words{}'.format(
'chapter {}: {:,} words{}'.format(
chapter_number,
chapter_word_count,
' ({})'.format(chapter_status) if chapter_status else '',
@ -86,12 +86,12 @@ def main():
if act_number is None:
continue
print('act {}: {} words (~{}%)'.format(act_number, act_word_count, act_word_count * 100 // total_word_count))
print('act {}: {:,} words (~{}%)'.format(act_number, act_word_count, act_word_count * 100 // total_word_count))
for status, status_word_count in word_count_by_status.items():
print('{}: {} words (~{}%)'.format(status, status_word_count, status_word_count * 100 // total_word_count))
print('{}: {:,} words (~{}%)'.format(status, status_word_count, status_word_count * 100 // total_word_count))
print('total: {} words'.format(total_word_count))
print('total: {:,} words'.format(total_word_count))
if __name__ == '__main__':