我格式的舍入值 php

Round values in my format php

如何舍入 nex 格式的值?

到 101.10,并且

至 101.20

我认为您正在寻找的功能是例如。 round( 101.11, 1, PHP_ROUND_HALF_UP)

结果将是:

101.11 101.1
101.12 101.1
101.13 101.1
101.14 101.1
101.15 101.2
101.16 101.2
101.17 101.2
101.18 101.2
101.19 101.2

希望对您有所帮助

在round()中使用第二个参数

http://php.net/manual/en/function.round.php