<?php
/**
 * Smarty plugin
 *
 * @category Smarty
 * @license /_licenses/untermStrich/agb_normal.pdf
 * @author Christian Wengg
 * @copyright 2010 untermStrich
 * @package Smarty
 * @subpackage plugins
 * @version $Id: function.islongfloat.php 772 2010-11-19 11:06:34Z christian.w $
*/

/**
 * Smarty float view function plugin
 *
 * Purpose:  Create the view for a float value with 6 digits past point
 *
 * @param   array   $params Parameters:
 *                  <ul>
 *                      <li>value   float     The variable</li>
 *                  </ul>
 * @return  string  The field source
 */
function smarty_function_islongfloat(array $params)
{
    if (isset($params['value'])) {
        $no_tsd = false;
        if (isset($params['no_tsd'])) {
            $no_tsd = $params['no_tsd'] ? true : false;
        }

        if ($params['value']) {
            if ($no_tsd) {
                return float_to_usnumber_no_tsd($params['value']);
            } else {
                return float_to_usnumber($params['value']);
            }
        } else {
            if ($no_tsd) {
                return float_to_usnumber_no_tsd(0);
            } else {
                return float_to_usnumber(0);
            }
        }
    } else {
        return '';
    }
}

