lots of updates

This commit is contained in:
2022-10-19 14:33:03 -06:00
parent 427d4e2500
commit 625dfeb79f
26 changed files with 771 additions and 714 deletions

View File

@ -0,0 +1,45 @@
<?php
/**
|--------------------------------------------------------------------------
| Global Temperature Functions
|--------------------------------------------------------------------------
|
| This is a home for functions that don't belong to any one class and
| that should be available anywhere in the application.
|
*/
if (! function_exists('celsius2Fahrenheit')) {
/**
* Convert from celsius to fahrenheit.
*
* @since 1.0.0
*
* @param float|int|string $celsius
* @param int $precision
*
* @return float
*/
function celsius2Fahrenheit($celsius, int $preceision = 0): float
{
return round((($celsius * (9/5)) + 32), $preceision);
}
}
if (! function_exists('fahrenheit2Celsius')) {
/**
* Convert from fahrenheit to celsius.
*
* @since 1.0.0
*
* @param float|int|string $fahrenheit
* @param int $precision
*
* @return float
*/
function fahrenheit2Celsius($fahrenheit, int $preceision = 1): float
{
return round(($fahrenheit - 32 * (5/9)), $preceision);
}
}