Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize downward rounding by using floor () function in PHP

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

This article will explain in detail how PHP uses the floor () function to achieve downward rounding. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Floor: round down

The floor () function rounds down to the nearest integer.

Syntax: floor (x)

Parameters.

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

Description: returns the next integer not greater than x, rounding off the fractional part of x. The type returned by floor () is still float, because the range of float values is usually larger than integer.

Example:

Output:

0055-6-6 on "PHP how to use floor () function to achieve downward rounding" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

Tags: Function article integer more good practical content parameter decimal number article knowledge type scope grammar part constant ratio reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei NVidia Shulou Information MySQL Shulou Technology