DelphiBasics
CelsiusToFahrenheit
Function
Convert a celsius temperature into fahrenheit StdConvs unit
 function CelsiusToFahrenheit ( const CelsiusValue : Double ) : Double;
Description
The CelsiusToFahrenheit function converts a CelsiusValue to fahrenheit.
Related commands
Convert Convert one measurement value to another
FahrenheitToCelsius Convert a fahrenheit temperature into celsius
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 Download this web site as a Windows program.




 
Example code : Convert 21 celsius to fahrenheit
// Full Unit code.
// -----------------------------------------------------------
// You must store this code in a unit called Unit1 with a form
// called Form1 that has an OnCreate event called FormCreate.
 
unit Unit1;
 
interface
 
uses
  StdConvs,   // Unit containing the CelsiusToFahrenheit command
  Forms, Dialogs;
 
type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  end;
 
var
  
Form1: TForm1;
 
implementation
{$R *.dfm} // Include form definitions
 
procedure TForm1.FormCreate(Sender: TObject);

var
  celsius, fahrenheit : Double;

begin
  // Define the celsius value
  celsius := 21.0;  // A nice warm day

  // Convert to farenheit
  fahrenheit := CelsiusToFahrenheit(celsius);

  // Show both values
  ShowMessageFmt('%f C  = %f F',[celsius, fahrenheit]);
end;
 
end.
Hide full unit code
   21.00 C = 69.80 F
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Home Page