Esempio n. 1
0
function format_currency($amount, $currency = null, $culture = null)
{
    if (null === $amount) {
        return null;
    }
    $numberFormat = new sfNumberFormat(_current_language($culture));
    return $numberFormat->format($amount, 'c', $currency);
}
/**
 * Format a number
 *
 * @param float $number
 * @param string $culture
 * 
 * @return string
 */
function format_number($number, $culture = null)
{
    if (is_null($number)) {
        return null;
    }
    $numberFormat = new sfNumberFormat(_current_language($culture));
    return $numberFormat->format($number);
}
Esempio n. 3
0
function format_currency($amount, $currency = null, $culture = null)
{
    if (null === $amount) {
        return null;
    }
    $numberFormat = new sfNumberFormat(_current_language($culture));
    //remove nbsp (sonst erkennt Excel keine Zahl)
    return substr($numberFormat->format($amount, 'c', $currency, 'ISO-8859-15'), 0, -1);
    //return rtrim($numberFormat->format($amount, 'c', $currency, 'ISO-8859-15'), '0\xa0');
}