Browse Source

Commas in numbers!

master
Dan Helfman 2 weeks ago
parent
commit
7a025bb18d
  1. 8
      novel_stats/novel_stats.py

8
novel_stats/novel_stats.py

@ -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__':

Loading…
Cancel
Save