From 58c15e621550e8be60d44635dfc6d8fef1c31102 Mon Sep 17 00:00:00 2001 From: Johannes Keyser Date: Mon, 2 Oct 2017 19:00:45 +0200 Subject: [PATCH] storage: Fix issue with locales that use other decimal separators - Convert commas to periods - Convert arabic decimal operator instead to period Signed-off-by: Johannes Keyser Reviewed-by: James Valleroy --- plinth/modules/storage/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plinth/modules/storage/views.py b/plinth/modules/storage/views.py index 8d3e72aba..1d6af98f4 100644 --- a/plinth/modules/storage/views.py +++ b/plinth/modules/storage/views.py @@ -104,6 +104,8 @@ def warn_about_low_disk_space(request): def _interpret_size_string(size_str): """Convert size string to number of bytes.""" + size_str = size_str.replace(',', '.') # some locales use commas + size_str = size_str.replace('٫', '.') # arabic decimal separator if size_str[-1] in '0123456789': return float(size_str[:-1])