⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uformatdisplay.pas

📁 中式财务栏 表格式录入 运行时设置可显示列、列名、列宽
💻 PAS
字号:
{*******************************************************}
{                                                       }
{       格式显示                                        }
{                                                       }
{       版权所有 (C) 2007 咏南工作室(陈新光)          }
{                                                       }
{*******************************************************}

unit uFormatDisplay;

interface

uses
  DB,DBGridEh,SysUtils,Classes; 

{ 设置数字或金额字段的显示格式 }
//procedure SetDisplayFormat(ADataset:TDataSet;AFormat:string='###,##0.00');
procedure SetDisplayFormat(AField:TField;AFormat:string='###,##0.00');
{ 设置财务栏 }
//procedure SetMoneyCol(AGrid:TDBGridEh;AFieldName:string);

implementation
{
procedure SetMoneyCol(AGrid:TDBGridEh;AFieldName:string);
var
  i:Integer;
begin
  AGrid.CHNCurrencyStyle.ZeroEmpty:=false;
  for i:=0 to AGrid.Columns.Count-1 do
  begin
    with AGrid do
    begin
      if Columns[i].FieldName=AFieldName then
      begin
        Columns[i].DisplayCHNCurrency:=True;
        Columns[i].DisplayZero:=True;
      end;
    end;
  end;
end;     }   
{
procedure SetDisplayFormat(ADataset:TDataSet;AFormat:string='###,##0.00');
var
  i:Integer;
begin
  for i:=0 to ADataset.FieldCount-1 do
  begin
    with ADataset do
    begin
      if Fields[i] is TBCDField then
        (Fields[i] as TBCDField).DisplayFormat :=AFormat;
    end;
  end;
end; }
procedure SetDisplayFormat(AField:TField;AFormat:string='###,##0.00');
begin
  if AField is TBCDField then
    TBCDField(AField).DisplayFormat:=AFormat;
end;  

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -