What is the correct mask?

mvemve
edited 8:51PM in FastReport 3.0
Hi!

I'd like to user the FormatFloat function, but I don't know how can I mask the float.
I found in the manual how can I mask a field:

http://www.fast-report.com/en/documentatio...3user/index.htm

[expression #tag]

Note that space between the expression and the "#" sign is obligatory! The tag itself might look as follows:

#nFormattingLine� the numerical format
#dFormattingLine� date/time format
#bFalse,True� boolean format

"FormattingLine" in every case is an argument for the function, with the help of which formatting is accomplished. Thus, for numerical formatting, such function would be the Delphi�s Format function, for date/time it is the FormatDateTime function. One can get the possible lines� values from the Delphi help system. Below are several values used in FastReport:

for the numerical formatting:
%g � a number with the minimal signs number after decimal point
%2.2f � a number with the fixed number of signs after decimal point
%2.2n � a number with bits delimiter
%2.2m � a monetary format, accepted in the Windows OS, depending on the regional settings in the control panel.

This masking technologie is working, but not in formatfloat function.

Memo1.Memo.Text := formatfloat('#n%2.2f', <frdbdsDataSet1."FIELDNAME">)
returns the following (the value of FIELDNAME is: 10 000):
"10000n%2" instead of "10000.00"

what is the correct way?

thanks!

Comments

  • mvemve
    edited 8:51PM
    mve wrote:
    what is the correct way?
    Memo1.Memo.Text := formatfloat('%.2n', <frdbdsDataSet1."FIELDNAME">)

    ;)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.