-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUSimulador.pas
43 lines (35 loc) · 1009 Bytes
/
USimulador.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
unit USimulador;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask, rxToolEdit, rxCurrEdit, ExtCtrls;
type
TfrmSimulador = class(TForm)
txtBase: TCurrencyEdit;
Label1: TLabel;
Label2: TLabel;
txtJuros: TCurrencyEdit;
Label3: TLabel;
txtParcelas: TCurrencyEdit;
pnTotal: TPanel;
pnParcela: TPanel;
btCalcular: TButton;
procedure btCalcularClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmSimulador: TfrmSimulador;
implementation
{$R *.dfm}
procedure TfrmSimulador.btCalcularClick(Sender: TObject);
var
Juros : Real;
begin
Juros := (txtBase.Value * txtJuros.Value) / 100;
pnTotal.Caption := FormatCurr('R$ #,##0.00', txtBase.Value + (txtParcelas.Value * Juros));
pnParcela.Caption := txtParcelas.Text + ' X ' + FormatCurr('R$ #,##0.00', (txtBase.Value + (txtParcelas.Value * Juros)) / txtParcelas.Value);
end;
end.