diff options
author | Laurie Clark-Michalek <bluepeppers@archlinux.us> | 2011-06-12 17:06:29 +0100 |
---|---|---|
committer | Laurie Clark-Michalek <bluepeppers@archlinux.us> | 2011-06-12 17:06:29 +0100 |
commit | 8ed5def21c30df5e98c22b34d863862bbc4be21b (patch) | |
tree | ba6af3390fe1fb25c1e3d90b31ce445007485148 | |
parent | b8a72dc1c5e91dbb42efe95be9841a6582d2e867 (diff) |
Fixed locale issue with decimal point.
-rwxr-xr-x | archey3 | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -227,9 +227,16 @@ class fsDisplay(display): raise def format_output(self, instring): + try: + decimal_point = self.call_command( + 'locale -ck decimal_point').split('\n')[1].split('=')[1] + except Exception as e: + self.logger.warning('Could not determine locale decimal point,' + + 'defaulting to \'.\', failed with error {0}'.format(e)) + decimal_point = '.' values = [line for line in instring.split('\n') if line][1].split() - used = values[3] - total = values[2] + used = values[3].replace(decimal_point, '.') + total = values[2].replace(decimal_point, '.') fstype = values[1] conversion_type = self.config.get('fs', 'unit', fallback="si").lower() conversions = self.conversions[conversion_type] |