Advertisement
hosttimer

duas somas usando e convertendo delphi string para Double

Oct 15th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.67 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  7.   System.Classes, Vcl.Graphics,
  8.   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     Button1: TButton;
  13.     procedure Button1Click(Sender: TObject);
  14.   private
  15.    i:Integer;
  16.    n:Double;
  17.     { Private declarations }
  18.   public
  19.     { Public declarations }
  20.   end;
  21.  
  22. var
  23.   Form1: TForm1;
  24.  
  25. implementation
  26.  
  27. {$R *.dfm}
  28.  
  29. procedure TForm1.Button1Click(Sender: TObject);
  30. var
  31. resultado:Double;
  32. begin
  33.  i:= 100;
  34.  n := 10.50;
  35.  resultado := i+n;
  36.  ShowMessage(FloatToStr(resultado));
  37. //FloatToStr de string para Double
  38. end;
  39.  
  40. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement