英文:
Round to upper integer in Fast-Report VCL
问题
我想将小数值四舍五入到最接近的整数,例如
10.25 = 11
30.79 = 31
1.1 = 2
Fast-Report中的round函数会将其四舍五入到最接近的整数,而不是向上取整。
我正在使用Fast-Report编程中的PascalScript语言。
英文:
I want to round decimal value to upper integer, for example
10.25 = 11
30.79 = 31
1.1 = 2
The round function in Fast-Report will round to nearest not the upper integer.
I'm using PascalScript language for Fast-Report coding.
答案1
得分: 0
Ceiling返回大于或等于d的最小整数。
示例:
Ceiling(1.7) = 2
如果不可用,您可以尝试以下解决方法:
x = 1.1
Round(x+0.49) = 2
英文:
Ceiling returns the smallest integer greater than or equal to d.
Example:
> Ceiling(1.7) = 2
If not available you could try this workaround:
> x = 1.1
> Round(x+0.49) = 2
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论