mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-19 23:47:01 -04:00
Tom git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@24 c3eb156b-1dc0-44e1-88ae-e38439141b53
21 lines
442 B
PHP
21 lines
442 B
PHP
<?php
|
|
function to_currency($number)
|
|
{
|
|
$CI =& get_instance();
|
|
$currency_symbol = $CI->config->item('currency_symbol') ? $CI->config->item('currency_symbol') : '$';
|
|
if($number >= 0)
|
|
{
|
|
return $currency_symbol.number_format($number, 2, '.', '');
|
|
}
|
|
else
|
|
{
|
|
return '-'.$currency_symbol.number_format(abs($number), 2, '.', '');
|
|
}
|
|
}
|
|
|
|
|
|
function to_currency_no_money($number)
|
|
{
|
|
return number_format($number, 2, '.', '');
|
|
}
|
|
?>
|