PageRenderTime 42ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/add-ons/smarty/plugins/modifier.number_format.php

https://github.com/jcplat/console-seolan
PHP | 25 lines | 7 code | 2 blank | 16 comment | 1 complexity | fcd8b191100ed8ab5b761a22d2cc539d MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, GPL-3.0, Apache-2.0, BSD-3-Clause
  1. <?php
  2. /*
  3. * Smarty plugin
  4. *
  5. -------------------------------------------------------------
  6. * File: modifier.number_format.php
  7. * Type: modifier
  8. * Name: number_format
  9. * Version: 1.0
  10. * Date: May 1st, 2002
  11. * Purpose: pass value to PHP number_format() and return result
  12. * Install: Drop into the plugin directory.
  13. * Author: Jason E. Sweat <jsweat_php@yahoo.com>
  14. *
  15. -------------------------------------------------------------
  16. */
  17. function smarty_modifier_number_format($string, $places=2, $dec=",", $thoussep=" ")
  18. {
  19. if (!$string) return $string;
  20. return number_format($string, $places, $dec, $thoussep);
  21. }
  22. /* vim: set expandtab: */
  23. ?>