diff options
author | Arun Isaac | 2023-01-19 18:20:46 +0000 |
---|---|---|
committer | Arun Isaac | 2023-01-19 18:20:46 +0000 |
commit | 62b010ad6b501207f10e57897baf9f23e508b20b (patch) | |
tree | e6f0664443d82070621bc3ecbe7494309c4fb183 /gn3 | |
parent | 53fd9b13d0ffb9f992b571ab5d6ddda58f7b9af3 (diff) | |
download | genenetwork3-62b010ad6b501207f10e57897baf9f23e508b20b.tar.gz |
search: Downcase before applying SI suffix.
* gn3/api/search.py (apply_si_suffix): Downcase before applying SI suffix.
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/api/search.py | 2 |
1 files changed, 1 insertions, 1 deletions
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) |