From 62b010ad6b501207f10e57897baf9f23e508b20b Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 19 Jan 2023 18:20:46 +0000 Subject: search: Downcase before applying SI suffix. * gn3/api/search.py (apply_si_suffix): Downcase before applying SI suffix. --- gn3/api/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gn3') diff --git a/gn3/api/search.py b/gn3/api/search.py index 820b74b..866b040 100644 --- a/gn3/api/search.py +++ b/gn3/api/search.py @@ -151,7 +151,7 @@ def parse_range(range_string: str) -> tuple[Maybe[str], Maybe[str]]: def apply_si_suffix(location: str) -> int: """Apply SI suffixes kilo, mega, giga and convert to bases.""" suffixes = {"k": 3, "m": 6, "g": 9} - if location[-1] in suffixes: + if location[-1].lower() in suffixes: return int(Decimal(location[:-1])*10**suffixes[location[-1].lower()]) else: return int(location) -- cgit v1.2.3