Re: Conversion Float => Integer
| From: | Michelle Konzack | Date: | Sat, 16 Sep 2017 16:22:00 +0000 |
| Subject: | Re: Conversion Float => Integer | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-326221@lists.php.net to get a copy of this message | ||
Hello Ashley,
On 2017-09-16 14:40:16 AshleySheridan hacked into the keyboard:
> There are a few ways:
>
> $int = intval($float);
Argh! -- This was exactly what I was looking for!
Had a provisory solution in for of a stringfunction which looks
absolutely courious :<D but it worked!!!
Normally I should not show it, but here it is:
$AVE = $TOT / date('t', strtotime($date)) . '.';
$POS = strpos($AVE, '.');
$LEN = strlen($AVE);
$LENGHT = $LEN - $POS;
$AVE = substr_replace($AVE, '', $POS, $LENGHT);
It is a KILLER I know!
Have a nice evening!
--
Michelle Konzack Miila ITSystems @ TDnet
GNU/Linux Developer 00372-54541400
Attachment: [application/pgp-signature] Digital signature signature.asc
Attachment: [application/pgp-signature] Digital signature signature.asc