Unit conversion (1024 B => 1 KB) must never take place when value map is defined for an item and match exists for a particular value. Currently, unit conversion is done regardless of whether a map is defined for the item. And mapping is applied afterwards over the converted value (see formatHistoryValue PHP function and Item value widget).
If a value map is defined for an item and match exists for a given non-converted value, no value formatting must take place. If decimal places are defined for displaying numeric items, those must be ignored in mentioned case.
If a value map is defined and there is no match for a specified value, the value must go through standard unit conversion.