This class provides several functions to perform some calculations.
Here is a list of available public methods for this class:
This function will return the net amount based on given brutto value and tax rate. If no percentage is given, the tax rate from the configuration will be used.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$brutto | mixed | Brutto amount. | ||
$tax | mixed | null | Optional value of given tax rate. |
Math::netto(19.95, 19);
This function will return the brutto amount based on given netto value and tax rate. If no percentage is given, the tax rate from the configuration will be used.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$netto | mixed | Brutto amount. | ||
$tax | mixed | null | Optional value of given tax rate. |
Math::brutto(16.764, 19);
This function calculate the percentage value based on given basic value and percentage. If no percentage is given, the tax rate from the configuration will be used.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$basic_value | mixed | Brutto amount. | ||
$percentage | mixed | null | Optional value of given percentage. |
Math::percentage_value(100, 10);
This function calculate the percentage based on given basic value and percentage value.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$basic_value | mixed | Basic value. | ||
$percentage_value | mixed | Percentage value. |
Math::percentage(100, 10);
This function calculate the basic value based on given percentage value and percentage. If no percentage is given, the tax rate from the configuration will be used.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$percentage_value | mixed | Percentage value. | ||
$percentage | mixed | null | Percentage. |
Math::basic_value(10, 10);
This function calculate the square metre value based on given values.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$length | mixed | Length value. | ||
$width | mixed | Width value. |
Math::square_metre(4, 3);
This function calculate the cubic metre value based on given values.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$length | mixed | Length value. | ||
$width | mixed | Width value. | ||
$height | mixed | Height value. |
Math::cubic_metre(4, 3, 2.5);
This function calculate how many litre water is given cubic metre.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$cubic_metre | mixed | Cubic metre value. |
Math::cubic_in_litre(16);
This function return miles per hour based on given values.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$miles | mixed | Miles value. | ||
$time | mixed | Time value. |
Math::mph(50, 1);
This function return kilometers per hour based on given values.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$km | mixed | Kilometer value. | ||
$time | mixed | Time value. |
Math::kmh(60, 1);
This function return kmh or mph based on given miles or kilometers.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$distance | mixed | Distance value. | ||
$time | mixed | Time value. | ||
$distance_unit | mixed | km | Distance unit: Possible values are "km" or "miles". | |
$speed_unit | mixed | kmh | Speed unit: Possible values are "kmh" or "mph". |
Math::speed(129, 70, 'km', 'kmh');
This function return given kilometers in miles.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$km | mixed | Kilometer value. |
Math::km_in_miles(50);
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$miles | mixed | Miles value. |
Math::miles_in_km(31.068);
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$value | Numeric | Source temperature value. | $source_scale | String | Source temperature scale. Valid scales: celsius, kelvin, rankine, fahrenheit, reaumur. |
$target_scale | String | Target temperature scale. Valid scales: celsius, kelvin, rankine, fahrenheit, reaumur. |
Math::temperature(17, 'celsius', 'fahrenheit');