Delphi Examples: DbiGetNumberFormat

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Delphi Examples: DbiGetNumberFormat

Return to chapter overview

Return the number format for the current session.

The number format is appended to the TStringList passed in. This example uses the following

 input:fDbiGetNumberFormat(MyNumberFormat);

 

The procedure is:

procedure fDbiGetNumberFormat(var NumberFormat: TStringList);

var

 FormatNumber: fmtNumber;

begin

 Check(DbiGetNumberFormat(FormatNumber));

with NumberFormat do begin

   Add('Decimal Separator: ' + FormatNumber.cDecimalSeparator);

   Add('Thousand Separator: ' + FormatNumber.cThousandSeparator);

   Add('Decimal Digits: ' + IntToStr(FormatNumber.iDecimalDigits));

  if (fmtNumber.bLeadingZero) then

     Add('Leading Zero: True')

  else

     Add('Leading Zero: False');

end;

end;