1. Home
  2. Computing & Technology
  3. Delphi Programming
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

FormatCurr

unit
Sysutils
category
numeric formatting routines

declaration
function FormatCurr(const Format: string; Value: Currency): string; overload;
function FormatCurr(const Format: string; Value: Currency; const FormatSettings: TFormatSettings): string; overload;

description
Returns a string from a currency point value using the provided format string.

The second form of FloatToStr, refers to localization information contained in the FormatSettings parameter.

example
var Salary : Currency;

Salary := 2.3132 * 12; // == 27,758.4

//sub example 1
ShowMessage(FormatCurr('###', Salary)); // == '27758'
ShowMessage(FormatCurr('00000000', Salary)); // == '00027758'
ShowMessage(FormatCurr('#,##00', Salary)); // == '27758.4000'

//sub example 2
ShowMessage(FormatCurr('"Salary = "#,#.0, Salary)); // == 'Salary = 27.758,4'

in real code

see also
CurrToStr,


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?
Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming

©2009 About.com, a part of The New York Times Company.

All rights reserved.