Leading Zeros
Hi all, is there any way to fotmat an integer like this? 1-> 0001
I've tried the function FormatMaskText whith the working EditMask string from Delphi but it didn't work. I didn't find any help about this FR function.
Can someone help me?
Tks!
Sergio
I've tried the function FormatMaskText whith the working EditMask string from Delphi but it didn't work. I didn't find any help about this FR function.
Can someone help me?
Tks!
Sergio
Comments
use this function, put it in your code
function AddLeadingZeroes(const aNumber, Length : integer) : string;
begin
result := SysUtils.Format('%.*d', [Length, aNumber]) ;
end;
make a variable in fastreport and fill it in delphi
make in the report the variable number
put this text in the variable [number]
in the frxreport1getvalue event type
if CompareText(VarName, 'number') = 0 then
value:= AddLeadingZeroes(-your number-,4);
Here is my solution
Number Format with Leading Zeros