public static function UnitInterface::getBaseFactor in Physical Fields 8
Gets the base factor for the given unit.
Used for converting measurements to and from the base unit. Use multiplication to convert a measurement to the base unit, and division to convert from the base unit (into the given unit).
Parameters
string $unit: The unit.
Return value
string The base factor.
5 methods override UnitInterface::getBaseFactor()
- AreaUnit::getBaseFactor in src/
AreaUnit.php - Gets the base factor for the given unit.
- LengthUnit::getBaseFactor in src/
LengthUnit.php - Gets the base factor for the given unit.
- TemperatureUnit::getBaseFactor in src/
TemperatureUnit.php - Gets the base factor for the given unit.
- VolumeUnit::getBaseFactor in src/
VolumeUnit.php - Gets the base factor for the given unit.
- WeightUnit::getBaseFactor in src/
WeightUnit.php - Gets the base factor for the given unit.
File
- src/
UnitInterface.php, line 41
Class
- UnitInterface
- Provides the interface for unit classes.
Namespace
Drupal\physicalCode
public static function getBaseFactor($unit);