���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/thietkewebvumi.com/smarty/plugins/ |
<?php /* * Smarty plugin * ------------------------------------------------------------- * Type: modifier * * Name: commify * * Purpose: format numbers by inserting thousands seperators * this is basically a wrapper for number_format * with additional processing to retain the original * digits after the decimal point (if any) * * Input: string: number to be formatted * decimals: [optional] number of decimal places * dec_point: [optional] decimal point character * thousands_sep: [optional] thousands seperator * * Examples: {$number|commify} 12345.288 => 12,345.288 * {$number|commify:2} 12345.288 => 12,345.29 * * Install: Drop into the plugin directory as modifier.commify.php. * * Author: James Brown <james [at] hmpg [dot] net> * ------------------------------------------------------------- */ function smarty_modifier_commify($string, $decimals=-1, $dec_point='.', $thousands_sep=',') { if ($decimals == -1) { if (preg_match('/(.*)\.(\d+.*)/', $string, $matches)) return number_format($matches[1], 0, $dec_point, $thousands_sep) . $dec_point . $matches[2]; else return number_format($string); } else return number_format($string, $decimals, $dec_point, $thousands_sep); } ?>