move currency to config file; change units to their own group in settings

This commit is contained in:
Nabeel Shahzad
2018-02-26 20:23:48 -06:00
parent 920b92c096
commit d61ade4482
15 changed files with 154 additions and 39 deletions

View File

@@ -15,7 +15,7 @@ class Altitude extends \PhpUnitsOfMeasure\PhysicalQuantity\Length implements Arr
*/
public function __toString()
{
$unit = setting('general.altitude_unit');
$unit = setting('units.altitude');
$value = $this->toUnit($unit);
return (string) round($value, 2);
}

View File

@@ -15,7 +15,7 @@ class Distance extends \PhpUnitsOfMeasure\PhysicalQuantity\Length implements Arr
*/
public function __toString()
{
$unit = setting('general.distance_unit');
$unit = setting('units.distance');
$value = $this->toUnit($unit);
return (string) round($value, 2);
}

View File

@@ -15,7 +15,7 @@ class Fuel extends \PhpUnitsOfMeasure\PhysicalQuantity\Mass implements Arrayable
*/
public function __toString()
{
$unit = setting('general.fuel_unit');
$unit = setting('units.fuel');
$value = $this->toUnit($unit);
return (string) round($value, 2);
}

View File

@@ -15,7 +15,7 @@ class Mass extends \PhpUnitsOfMeasure\PhysicalQuantity\Mass implements Arrayable
*/
public function __toString()
{
$unit = setting('general.weight_unit');
$unit = setting('units.weight');
$value = $this->toUnit($unit);
return (string) round($value, 2);
}

View File

@@ -15,7 +15,7 @@ class Velocity extends \PhpUnitsOfMeasure\PhysicalQuantity\Velocity implements A
*/
public function __toString()
{
$unit = setting('general.speed_unit');
$unit = setting('units.speed');
$value = $this->toUnit($unit);
return (string) round($value, 2);
}

View File

@@ -15,7 +15,7 @@ class Volume extends \PhpUnitsOfMeasure\PhysicalQuantity\Volume implements Array
*/
public function __toString()
{
$unit = setting('general.liquid_unit');
$unit = setting('units.volume');
$value = $this->toUnit($unit);
return (string) round($value, 2);
}