src/Nomnom/Nomnom.php
public function toBest($precision = null)
    {
        $fromUnit = UnitResolver::resolve($this->from);
        $base = $this->getBase() == 2 ? 1024 : 1000;
        $converted = $this->start;
        while ($converted >= 1) {
            $fromUnit++;
            $result = $this->div($this->start, pow($base, $fromUnit), $precision);
            if ($result <= 1) return $converted;
            $converted = $result;
        }
        return $converted;
    }
public function toBest($precision = null)
    {
        $fromUnit = UnitResolver::resolve($this->from);
        $base = $this->getBase() == 2 ? 1024 : 1000;
        $converted = $this->start;
        while ($converted >= 1) {
            $fromUnit++;
            $result = $this->div($this->start, pow($base, $fromUnit), $precision);
            if ($result <= 1) return $converted;
            $converted = $result;
        }
        return $converted;
    }
public function toBest ( $ precision = null ) { $ fromUnit = UnitResolver :: resolve ( $ this -> from ) ; $ base = $ this -> getBase ( ) == 2 ? 1024 : 1000 ; $ converted = $ this -> start ; while ( $ converted >= 1 ) { $ fromUnit ++ ; $ result = $ this -> div ( $ this -> start , pow ( $ base , $ fromUnit ) , $ precision ) ; if ( $ result <= 1 ) return $ converted ; $ converted = $ result ; } return $ converted ; }
Convert the start value to it's highest whole unit.
Accespts an optional precision for how many significant digits
to retain

@param int|null $precision
@return float
Convert the start value to it s highest whole unit . Accespts an optional precision for how many significant digits to retain