在水晶报表中将整数形式的总时间转换为HH:MM格式 [英] Converting total time in integer into HH:MM format in crystal report
本文介绍了在水晶报表中将整数形式的总时间转换为HH:MM格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用以下给定的公式在水晶报表中将3.50小时更改为03:30(HH:MM)格式,但显示04:30(自动添加1小时)
I am using below given formula to change 3.50 hours to 03:30(HH:MM) format in crystal report but it showing 04:30(1 hr added automatically)
numbervar totalHours:=ToNumber({Table.ExtraHoursOn1});
numbervar totalminutes:=ToNumber({Table.ExtraHoursOn1})*60 mod 60;
ToText(totalHours,0)+':'+
ToText(totalminutes,'00')
我不知道我哪里出了错。
I don't know where i am getting wrong.
推荐答案
这是更改格式,缺少截断功能
This is the right syntax for changing the format, truncate function was missing
numbervar totalHours:=ToNumber({Table.ExtraHoursOn1});
numbervar totalminutes:=ToNumber({Table.ExtraHoursOn1})*60 mod 60;
ToText(Truncate(totalHours),0)+':'+
ToText(totalminutes,'00')
这篇关于在水晶报表中将整数形式的总时间转换为HH:MM格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文