0

I'd like bcadd(4.9,3) to return 8 rather than 7. I'm using an example without lots of decimal places here, but the basic idea (that I want to round, rather than truncate) still stands. How do I do this?

4

1 回答 1

1

bcadd让您指定精度(和bcscale)。如果您有一个小数最大值,您可以将其更改为bcadd(4.9,3,$some_huge_number).. 然后您可以使用round().

于 2012-01-24T19:59:20.327 回答