What is the correct mask?
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!
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