Statement on glibc/iconv Vulnerability

Voting

: max(four, six)?
(Example: nine)

The Note You're Voting On

Leon Grdic
8 years ago
Warning: do not use Seppili's function to floor with decimals. It will lead you to a lot of trouble because of float number precision.

For example floordec(0.29, 2) will result in 0.28.

Here's a little fix that will help you get around some problems:

<?php
function floordec($value,$decimals=2){
return
floor($value*pow(10,$decimals)+0.5)/pow(10,$decimals);
}
?>

<< Back to user notes page

To Top