Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize upward rounding by using ceil () function in PHP

Shulou Source: shulou.com Published: 2022-06-01 02:32:17 09月14日 Update

This article mainly shows you "PHP how to use ceil () function to achieve upward rounding", the content is easy to understand, clear, hope to help you solve your doubts, the following let Xiaobian lead you to study and learn "PHP how to use ceil () function to achieve upward rounding" this article.

Ceil: rounding up

The ceil () function rounds up to the nearest integer.

Syntax: ceil (x)

Parameters.

X must. The number that is required to be rounded.

Description: returns the next integer not less than x, and x enters one place if there is a decimal part. The type returned by ceil () is still float, because the range of float values is usually larger than integer.

Example:

Tags: Functions content articles integers learning help parameters decimals numbers easy to understand more organization knowledge type ribbon scope industry grammar information information channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei OPPO Reno MySQL MariaDB Xiaomi