From bce811ba494d5b07f1ea6481f659f2e121fa3b02 Mon Sep 17 00:00:00 2001 From: mariocesar Date: Wed, 11 Jan 2023 11:50:58 -0400 Subject: [PATCH] Typing --- bolivia_cc/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bolivia_cc/utils.py b/bolivia_cc/utils.py index b63df4c..20b8afc 100644 --- a/bolivia_cc/utils.py +++ b/bolivia_cc/utils.py @@ -91,6 +91,7 @@ def base10to64(number: int) -> str: return result -def round_half_up(n, decimals=0): - multiplier = 10**decimals +def round_half_up(n: float, decimals: int = 0) -> float: + """Round a float value to half or up.""" + multiplier: int = 10**decimals return floor(n * multiplier + 0.5) / multiplier