⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tfincalc.pas

📁 五个最常用的财务金融计算公式 ( FV
💻 PAS
字号:
unit Tfincalc;

interface

uses
  SysUtils, Windows, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    RadioGroup1: TRadioGroup;
    Edit1: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Edit2: TEdit;
    Label3: TLabel;
    Edit3: TEdit;
    Label4: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure RadioGroup1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
uses fincalc;

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
Case RadioGroup1.ItemIndex of
 0:  Label4.caption := Format('%8.2f',[TFV(StrToFloat(Edit1.Text),
     StrToFloat(Edit2.Text), StrToInt(Edit3.Text))]);
 1:  Label4.caption := format('%8.2f',[TExp(StrToFloat(Edit1.Text),
     StrToFloat(Edit2.Text))]);
 2:  Label4.caption := format('%8.2f',[TPV(StrToFloat(Edit1.Text),
     StrToFloat(Edit2.Text), StrToInt(Edit3.Text))]);
 3:  Label4.caption := format('%8.2f',[TPVa(StrToFloat(Edit1.Text),
     StrToFloat(Edit2.Text), StrToInt(Edit3.Text))]);
 4:  Label4.caption := format('%8.2f',[TPMT(StrToFloat(Edit1.Text),
     StrToFloat(Edit2.Text), StrToInt(Edit3.Text))]);
 5:  Label4.caption := format('%8.2f',[TFVa(StrToFloat(Edit1.Text),
     StrToFloat(Edit2.Text), StrToInt(Edit3.Text))])
 else
 end;

end;

procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
Case RadioGroup1.ItemIndex of
0:
  begin
    label1.caption := 'Present Value';
    label2.caption := 'Annual Interest Rate';
    label3.caption := 'Term';
  end;
1:
  begin
    Label1.caption := 'Base';
    Label2.caption := 'Exponent';
    label3.caption := '';
  end;
2:
  begin
    label1.caption := 'Future Value';
    label2.caption := 'Annual Interest Rate';
    label3.caption := 'Term';
  end;
3:
  begin
    label1.caption := 'Payment';
    label2.caption := 'Interest Rate';
    label3.caption := 'Term';
  end;
4:
  begin
    label1.caption := 'Principle';
    label2.caption := 'Interest Rate';
    label3.caption := 'Term';
  end;
5:
  begin
    label1.caption := 'Payment';
    label2.caption := 'Interest Rate';
    label3.caption := 'Term';
  end;
else
end;

end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -