I am creating a function (hopefully) that will convert English measure units into Metric System for my weather application. The units the function returns will be celcius, millibars, millimeters, knots, and Kilometers. Currently I have variables that work on another variable to get this done.
for example:
Code: Select all
$metricVariable = round(($Variable * foo),2);
The problem is that I have basically 4 formulas that have to be worked on and I have forgotten how to pass and retrieve information into my function.
My idea is to create the function:
Code: Select all
convertMetrics()
{
switch here perhaps
}
Passing in the variable name to be converted, the original units, and the units to be output...
ie) convertMetrics($currentTemp, F, C)
not sure how to set this up though...
Any help is appreciated!