From 148f9392ceaf8626c4f7c0ea96814f65bac484bb Mon Sep 17 00:00:00 2001 From: dgw Date: Wed, 1 Apr 2020 13:47:26 -0500 Subject: [PATCH] units: fix mass when given exactly 1 pound / 16 ounces Reported on IRC by sukil. --- sopel/modules/units.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sopel/modules/units.py b/sopel/modules/units.py index 5f9e2fc82d..3f9483b38a 100644 --- a/sopel/modules/units.py +++ b/sopel/modules/units.py @@ -174,8 +174,8 @@ def mass(bot, trigger): pound = int(ounce) // 16 ounce = ounce - (pound * 16) - if pound > 1: - stupid_part = '{} pounds'.format(pound) + if pound >= 1: + stupid_part = '{} {}'.format(pound, 'pound' if pound == 1 else 'pounds') if ounce > 0.01: stupid_part += ' {:.2f} ounces'.format(ounce) else: