Pop\Shipping\Adapter\Usps::setWeight PHP Метод

setWeight() публичный Метод

Set dimensions
public setWeight ( string $weight, string $unit = null ) : void
$weight string
$unit string
Результат void
    public function setWeight($weight, $unit = null)
    {
        if (is_float($weight)) {
            $lbs = floor($weight);
            $ozs = round(16 * ($weight - floor($weight)), 2);
        } else {
            $lbs = $weight;
            $ozs = 0;
        }
        $this->weight['Pounds'] = $lbs;
        $this->weight['Ounces'] = $ozs;
    }