delphi 如何保留小数
G_sql:='selecta.所属公司,a.所属单位,a.销售日期,sum(a.盈利)as盈利合计'+',a.单价as销售金额,a.进价as成本合计,b.税率*(a.合...
G_sql:=' select a.所属公司,a.所属单位,a.销售日期,sum(a.盈利) as 盈利合计'+
' ,a.单价 as 销售金额,a.进价 as 成本合计,b.税率*(a.合计/(1+b.税率)) as 含税金额,a.合计/(1+b.税率) as 不含税金额,count(a.id) as 数量 '+
' from xs_xsmx a left join wp_wpzl b on (a.编号=b.编号)'+
s_sql1+
' group by a.所属公司,a.所属单位,b.税率,a.销售日期,a.单价,a.合计,a.进价 '+
' order by a.所属公司,a.所属单位,a.销售日期';
ADOQuery3.close;
ADOQuery3.sql.clear;
ADOQuery3.sql.add(G_sql);
ADOQuery3.open;
G_sql:=' select sum(盈利) as 盈利合计,sum(进价) as 成本合计,sum(单价) as 销售金额'+
' from xs_xsmx'+
s_sql1;
MyData.ADOQuery_temp_cmb.close;
MyData.ADOQuery_temp_cmb.SQL.clear;
MyData.ADOQuery_temp_cmb.sql.add(G_sql);
MyData.ADOQuery_temp_cmb.open;
就是在这里里面将含税金额和不含税金额保留4位小数,如何添加啊 展开
' ,a.单价 as 销售金额,a.进价 as 成本合计,b.税率*(a.合计/(1+b.税率)) as 含税金额,a.合计/(1+b.税率) as 不含税金额,count(a.id) as 数量 '+
' from xs_xsmx a left join wp_wpzl b on (a.编号=b.编号)'+
s_sql1+
' group by a.所属公司,a.所属单位,b.税率,a.销售日期,a.单价,a.合计,a.进价 '+
' order by a.所属公司,a.所属单位,a.销售日期';
ADOQuery3.close;
ADOQuery3.sql.clear;
ADOQuery3.sql.add(G_sql);
ADOQuery3.open;
G_sql:=' select sum(盈利) as 盈利合计,sum(进价) as 成本合计,sum(单价) as 销售金额'+
' from xs_xsmx'+
s_sql1;
MyData.ADOQuery_temp_cmb.close;
MyData.ADOQuery_temp_cmb.SQL.clear;
MyData.ADOQuery_temp_cmb.sql.add(G_sql);
MyData.ADOQuery_temp_cmb.open;
就是在这里里面将含税金额和不含税金额保留4位小数,如何添加啊 展开
2个回答
展开全部
FormatFloat('0.00',edit1.text);
追问
能告诉具体的么,新手,添加到哪里啊,完全的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询