Get an appropriate display unit for a given base unit and scale factor.
Use this method to render scaled data value units. Typically you would first call
Util.Numbers.displayScaleForValue, passing in the largest expected value
in a set of data, and then pass the result to this method to generate a display unit
for the base unit for that data.
For example, given a base unit of W (watts) and a maximum data value of 10000:
Get an appropriate display unit for a given base unit and scale factor.
Use this method to render scaled data value units. Typically you would first call Util.Numbers.displayScaleForValue, passing in the largest expected value in a set of data, and then pass the result to this method to generate a display unit for the base unit for that data.
For example, given a base unit of
W
(watts) and a maximum data value of10000
:The
displayUnit
result in that example would bekW
.