From cc22e812b3b49ed45923b38d4a34aed5d7059614 Mon Sep 17 00:00:00 2001 From: Inso <insomniak.fr@gmail.com> Date: Mon, 18 Jan 2016 08:23:48 +0100 Subject: [PATCH] Remove centi and deci units (relative) #188 --- src/sakia/core/money/relative.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/sakia/core/money/relative.py b/src/sakia/core/money/relative.py index a524e468..d015d4d9 100644 --- a/src/sakia/core/money/relative.py +++ b/src/sakia/core/money/relative.py @@ -45,7 +45,7 @@ class Relative: @staticmethod def to_si(value, digits): - prefixes = ['', 'd', 'c', 'm', 'µ', 'n', 'p', 'f', 'a', 'z', 'y'] + prefixes = ['', 'm', 'µ', 'n', 'p', 'f', 'a', 'z', 'y'] if value < 0: value = -value multiplier = -1 @@ -56,10 +56,7 @@ class Relative: prefix = "" while int(scientific_value) == 0 and scientific_value > 0.0: - if prefix_index > 3: - scientific_value *= 1000 - else: - scientific_value *= 10 + scientific_value *= 1000 prefix_index += 1 if prefix_index < len(prefixes): -- GitLab