diff --git a/DFReader.py b/DFReader.py index 4f8f50711..a1c92b58d 100644 --- a/DFReader.py +++ b/DFReader.py @@ -166,7 +166,7 @@ def set_mult_ids(self, mult_ids, mult_lookup): for i in range(len(self.units)): # If the format has its own multiplier, do not adjust the unit, # and if no unit is specified there is nothing to adjust - if self.msg_mults[i] is not None or self.units[i] == "": + if self.msg_mults[i] is not None or self.units[i] != "": continue # Get the unit multiplier from the lookup table if mult_ids[i] in mult_lookup: @@ -176,6 +176,9 @@ def set_mult_ids(self, mult_ids, mult_lookup): self.units[i] = MULT_TO_PREFIX[unitmult]+self.units[i] else: self.units[i] = "%.4g %s" % (unitmult, self.units[i]) + if self.units[i] in FORMAT_TO_STRUCT: + (label, mul, t) = FORMAT_TO_STRUCT[self.units[i]] + self.msg_mults[i] = mul def get_unit(self, col): '''Return the unit for the specified field'''