DelphiBasics
FahrenheitToCelsius
Function
Convert a fahrenheit temperature into celsius StdConvs unit
 function FahrenheitToCelsius(const FahrenheitValue Double):Double;
Description
The FahrenheitToCelsius function converts a FahrenheitValue to celsius.
Related commands
CelsiusToFahrenheitConvert a celsius temperature into fahrenheit
ConvertConvert one measurement value to another
 Download this web site as a Windows program.




 
Example code : Convert body temperature in fahrenheit to celsius
var
  celsius, fahrenheit : Double;

begin
  // Define the fahrenheit value
  fahrenheit := 98.4;  // Human body temperature

  // Convert to celsius
  celsius := FahrenheitToCelsius(fahrenheit);

  // Show both values
  ShowMessageFmt('%f F  = %f C',[fahrenheit, celsius]);
end;
Show full unit code
  98.40 F = 36.89 C
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page