bcfloor

(PHP 8 >= 8.4.0)

bcfloor β€” Round down arbitrary precision number

Опис

bcfloor(string $num): string

Returns the next lowest integer value by rounding down num if necessary.

ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ΠΈ

num
The value to round.

ЗначСння, Ρ‰ΠΎ ΠΏΠΎΠ²Π΅Ρ€Ρ‚Π°ΡŽΡ‚ΡŒΡΡ

Returns a numeric string representing num rounded down to the nearest integer.

Помилки/Π²ΠΈΠΊΠ»ΡŽΡ‡Π΅Π½Π½Ρ

This function throws a ValueError if num is not a well-formed BCMath numeric string.

ΠŸΡ€ΠΈΠΊΠ»Π°Π΄ΠΈ

ΠŸΡ€ΠΈΠΊΠ»Π°Π΄ #1 bcfloor() example

<?php
var_dump
(bcfloor('4.3'));
var_dump(bcfloor('9.999'));
var_dump(bcfloor('-3.14'));
?>

Поданий Π²ΠΈΡ‰Π΅ ΠΏΡ€ΠΈΠΊΠ»Π°Π΄ Π²ΠΈΠ²Π΅Π΄Π΅:

string(1) "4"
string(1) "9"
string(2) "-4"

ΠŸΡ€ΠΎΠ³Π»ΡΠ½ΡŒΡ‚Π΅ Ρ‚Π°ΠΊΠΎΠΆ

  • bcceil() - Round up arbitrary precision number
  • bcround() - Round arbitrary precision number
  • BcMath\Number::floor()
οΌ‹add a note

User Contributed Notes

There are no user contributed notes for this page.