Fix for bad unit conversions in API responses
This commit is contained in:
@@ -22,8 +22,12 @@ class Volume extends Unit
|
||||
* @throws \PhpUnitsOfMeasure\Exception\NonNumericValue
|
||||
* @throws \PhpUnitsOfMeasure\Exception\NonStringUnitName
|
||||
*/
|
||||
public function __construct(float $value, string $unit)
|
||||
public function __construct($value, string $unit)
|
||||
{
|
||||
if (empty($value)) {
|
||||
$value = 0;
|
||||
}
|
||||
|
||||
$this->unit = setting('units.volume');
|
||||
$this->instance = new VolumeUnit($value, $unit);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user