This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function number_to_string($number): string | |
{ | |
$whole = floor($number); | |
$decimal = bcsub($number, $whole, 2); | |
$decimalPrefix = (-1 === bccomp($decimal, 0.1, 2)) ? 'zéro ' : ''; | |
$decimal = bcmul($decimal, 100, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!defined('BASEPATH')) | |
exit('No direct script access allowed'); | |
if (!function_exists('number_str')) { | |
function number_str($number) { | |
$strp = strpos($number, '.'); | |
$n = $strp > 0 ? substr($number, 0, $strp) : $number; |