以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]统计直接四舍五入了  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=130971)

--  作者:yds
--  发布时间:2019/2/13 12:04:00
--  [求助]统计直接四舍五入了
Dim dy As Date = Date.today
Dim Filter As String
Filter = "Y = \'" & dy.AddMonths(-1).Year & "\' And M = \'" & dy.AddMonths(-1).Month & "\'" 
Dim g As New SQLGroupTableBuilder("考勤统计", "考勤")
g.C
g.Filter = Filter
g.AddTable("考勤","姓名","人员","姓名")
g.Decimals = 2
g.Groups.AddDef("部门")
g.Groups.AddDef("{考勤}.姓名")
g.Totals.AddExp("考勤","考勤 / 480", "上班(天)")
g.Totals.AddExp("请假","请假 / 480","请假(天)")
g.Totals.AddExp("加班","加班 / 60","加班(小时)")
g.Totals.AddExp("迟到次","迟到次 * 1","迟到(次)")
g.Totals.AddExp("早退次","早退次 * 1","早退(次)")
g.Build()
MainTable = Tables("考勤统计")

统计结果考勤列的数都是整数,要怎么保留两位小数?

--  作者:有点甜
--  发布时间:2019/2/13 12:18:00
--  

1、

 

g.Totals.AddExp("考勤","考勤 / 480.0", "上班(天)")

 

2、生成后,设置列格式

 

http://www.foxtable.com/webhelp/scr/2046.htm