## Format in Engineering Notation

If you have a value and SI unit – for example 2000W – and you want to display this in engineering notation – 2kW – then this may help. /** * Format a float in engineering notation * @value float floating point number * @units string like W for Watt * @return array */ function Eng ($value, $units) { // Exceptions if (is_null($value)) { return array( ‘value’ => NULL, ‘units’ => $units, ‘decimals’ => 0,…