There is no display format that would accomplish this, however you can override the string formating in the GetText event of the field and format the string yourself. For example:
liIndex := Length(lsBack); while (liIndex > 1) do begin if (lsback[liIndex] = '0') then lsBack[liIndex] := '#' else break; end;
for liIndex := 0 to 5 - Length(lsFront) - 1 do lsFront := '#' + lsFront;
for liIndex := 0 to 5 - Length(lsback) - 1 do lsBack := lsBack + '#';
Text := Concat(lsFront, Concat('.', lsBack));
end;
This example assumes that the field is 11 characters long, a single trailing zero, and a maximum of 5 trailing decimals places. Replace # with space or any other padding character.
Comments
override the string formating in the GetText event of the field and format
the string yourself. For example:
procedure TForm1.ppDBText1GetText(Sender: TObject; var Text: String);
var
lsFront: String;
lsBack: String;
liIndex: Integer;
begin
liIndex := Pos('.', Text);
lsFront := Copy(Text, 1, liIndex - 1);
lsBack := Copy(Text, liIndex + 1, Length(Text) - liIndex);
liIndex := Length(lsBack);
while (liIndex > 1) do
begin
if (lsback[liIndex] = '0') then
lsBack[liIndex] := '#'
else
break;
end;
for liIndex := 0 to 5 - Length(lsFront) - 1 do
lsFront := '#' + lsFront;
for liIndex := 0 to 5 - Length(lsback) - 1 do
lsBack := lsBack + '#';
Text := Concat(lsFront, Concat('.', lsBack));
end;
This example assumes that the field is 11 characters long, a single trailing
zero, and a maximum of 5 trailing decimals places. Replace # with space or
any other padding character.
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com