在Fast-Report VCL中将数字四舍五入到最接近的整数:

huangapple go评论83阅读模式
英文:

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

huangapple
  • 本文由 发表于 2023年7月10日 18:21:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76652807.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定