Forum: Pascal and Delphi Jul 6th, 2009 |
| Replies: 6 Views: 455 I like this line:
WriteLn('The balance is: ',balance:0:0);
Very neat.
Sub Xero |
Forum: Pascal and Delphi Jul 5th, 2009 |
| Replies: 5 Views: 679 It should be exactly the same. Format returns a string, so there's no difference in applying the result to an Editbox or a label.
What exactly is the problem?
Sub Xero |
Forum: Pascal and Delphi Jul 5th, 2009 |
| Replies: 5 Views: 679 Use the Format command like this:
VolumeCalc.Caption := Format('%.2f',[StrToFloat(EngineSizeVal.Text) / 2 / StrToFloat(CylNumVal.Text)]);
Sub Xero |
Forum: Pascal and Delphi Jul 5th, 2009 |
| Replies: 6 Views: 455 Your main problem is 'balance' should be a real type, as multiplying it by 1.03 will return a non integer value. Here's how I'd do it:
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils; |