温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

FastReport中怎么定义报表大写金额

发布时间:2022-01-04 18:16:24 来源:亿速云 阅读:338 作者:柒染 栏目:大数据

这篇文章给大家介绍FastReport中怎么定义报表大写金额,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

我们在设计FastReport报表时,遇到客户有可能需要显示的是大写金额,可以用如下方法设计报表解决.

首先要改为大写金额的用[tt]做为变量定义

FastReport中怎么定义报表大写金额

然后在文本编辑器里写代码

FastReport中怎么定义报表大写金额

代码:

begin
  qianwei:=-2;
  Smallmonth:=formatfloat('0.00',[QueryBody."iamt"]);
  dianweizhi :=pos('.',Smallmonth);
  tt :='';
  BigMonth:='';
  qian:=length(Smallmonth);
  while qian>0 do
  begin
    if qian<>dianweizhi then
    begin
      i:=copy(Smallmonth,qian,1);
      if i='1' then wei1:='壹'
      else if i='2' then wei1:='贰'
      else if i='3' then wei1:='叁'
      else if i='4' then wei1:='肆'
      else if i='5' then wei1:='伍'
      else if i='6' then wei1:='陆'
      else if i='7' then wei1:='柒'
      else if i='8' then wei1:='捌'
      else if i='9' then wei1:='玖'
      else if i='0' then wei1:='零';
      if qianwei=-3      then  qianwei1:='厘'
      else if qianwei=-2 then  qianwei1:='分'
      else if qianwei=-1 then  qianwei1:='角'
      else if qianwei=0  then  qianwei1:='元'
      else if qianwei=1  then  qianwei1:='拾'
      else if qianwei=2  then  qianwei1:='佰'
      else if qianwei=3  then  qianwei1:='千'
      else if qianwei=4  then  qianwei1:='万'
      else if qianwei=5  then  qianwei1:='拾'
      else if qianwei=6  then  qianwei1:='佰'
      else if qianwei=7  then  qianwei1:='千'
      else if qianwei=8  then  qianwei1:='亿'
      else if qianwei=9  then  qianwei1:='十'
      else if qianwei=10 then  qianwei1:='佰'
      else if qianwei=11 then  qianwei1:='千';
      inc(qianwei);
      BigMonth :=wei1+qianwei1+BigMonth;
    end;
    dec(qian);
  end;
  tt := BigMonth;
end

按照上面的办法轻松搞定.

关于FastReport中怎么定义报表大写金额就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI