toUnit($unit); return (string) round($value, 2); } /** * For the HTTP Resource call */ public function toObject() { return [ 'kg' => round($this->toUnit('kg'), 2), 'lbs' => round($this->toUnit('lbs'), 2), ]; } /** * Get the instance as an array. * @return array */ public function toArray() { return round($this->toUnit( config('phpvms.internal_units.mass') ), 2); } }