Home  >  Article  >  Backend Development  >  How to use php ceil function?

How to use php ceil function?

藏色散人
藏色散人Original
2019-05-23 10:27:075266browse

php The ceil() function is used to round up to the nearest integer. The syntax is "ceil(num)", which means that the next integer that is not less than the parameter num is returned; if there is no decimal, the parameter num is returned. If there is a decimal part, the decimal part is discarded and moved forward by one place. For example, "ceil(99.4)" returns 100.

How to use php ceil function?

php ceil() function

Function: The function of ceil() function is to round up to the nearest Integer

Syntax:

ceil(number)

Parameters:

number, must be a number,

Description: Returns the next integer that is not less than the parameter number , if there is no decimal, return the parameter number. If there is a decimal part, discard the decimal part and advance one place. Note that it is not rounded. When the parameter is a string string, 0 is returned.

php ceil ()Function example

Output:

101*****100*****-99*****0

The above is the detailed content of How to use php ceil function?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn