Link to home
Start Free TrialLog in
Avatar of dabbiX
dabbiXFlag for Iceland

asked on

FormatFloat in Delphi

How to use FormatFloat  in Delphi
ASKER CERTIFIED SOLUTION
Avatar of Emmanuel PASQUIER
Emmanuel PASQUIER
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dabbiX

ASKER

How to use FormatFloat  in Delphi
ok
in memo;

 Edit2.Text :=FormatFloat('#,##0.00',debet);
 Edit3.Text :=FormatFloat('#,##0.00',kredit);
 memo1.Lines.Add('d.. '+Edit2.Text);
 memo1.Lines.Add('k.. '+Edit3.Text);

How to get  Algin :=  Right ;
easiest way : you set that in the memo option
memo1.Alignment := taRightJustify;
Avatar of dabbiX

ASKER

memo1.Alignment := taRightJustify;

that is no way.

I want memo1.Lines.Add('d.. '+Edit2.Text);

to by RightJustify
Avatar of dabbiX

ASKER

s :=FormatFloat('#,##0.00',debet);
s1 :=FormatFloat('#,##0.00',debet);

memo1.Lines.Add('d.. '+s);
memo1.Lines.Add('d.. '+s1);

s and s1      to by  =    RightJustify

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Dabby !

Did we gave you enough info about how to use Format functions ? There is plenty more information in Delphi Help.

LocaleFormatSettings can give you also a lot of options to control how your application can format values (floats, dates, time etc..) but I recommend not playing too much with those, except if you really need setting specific display standards in your entire application. Playing too much with those global settings could well have an undesired effect on other components, some of which you maybe don't have the code.

PS : Thanks Geert for the %n tip, I have always overlooked that one. I don't use much thousand separators, but who knows, maybe one day I will need it !
Avatar of Mike McCracken
Mike McCracken

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.