title: Cast double to int inside Smarty
body: <p><br><br>
  I am trying to display <code>double</code> variable inside an Smarty environment converting it into <code>int</code>.</p>
  
  <p>The File configuring the variables has the following code.
  The Variable PRODUCTS_Quantity_x is the viewed Variable which I added. It is giving me a comma separated value with 3 fractional digits. The <code>{$module_data.PRODUCTS_Quantity}</code> is already be able to get displayed in through the html.
  I have already tryed things like count() etc. I mostly got an empty variable or smarty errors ... <br></p>
  
  <pre><code>            $t_data_array = array ( 'PRODUCTS_NAME'                     =&gt; htmlspecialchars_wrapper($array['products_name']),
                              'COUNT'                             =&gt; $array['ID'],
                              'PRODUCTS_ID'                       =&gt; $array['products_id'],
                              'PRODUCTS_VPE'                      =&gt; $this-&gt;getVPEtext($array, $products_price['plain']),
                              'PRODUCTS_IMAGE'                    =&gt; $this-&gt;productImage($array['products_image'], $image),
                              'PRODUCTS_IMAGE_W'                  =&gt; $array['products_image_w'],
                              'PRODUCTS_IMAGE_H'                  =&gt; $array['products_image_h'],
                              'PRODUCTS_IMAGE_WIDTH'              =&gt; PRODUCT_IMAGE_THUMBNAIL_WIDTH,
                              'PRODUCTS_IMAGE_PADDING'            =&gt; ((PRODUCT_IMAGE_THUMBNAIL_HEIGHT + 8) - $array['products_image_h'])/2,
                              'PRODUCTS_IMAGE_ALT'                =&gt; $array['gm_alt_text'],
                              'PRODUCTS_LINK'                     =&gt; $gm_product_link,
                              'PRODUCTS_PRICE'                    =&gt; $products_price['formated'],
                              'PRODUCTS_TAX_INFO'                 =&gt; $gm_tax_info,
                              'PRODUCTS_SHIPPING_LINK'            =&gt; $gm_shipping_link,
                              'PRODUCTS_BUTTON_BUY_NOW'           =&gt; $buy_now,
                              'GM_PRODUCTS_BUTTON_BUY_NOW_URL'    =&gt; $gm_buy_now_url,
                              'GM_PRODUCTS_BUTTON_BUY_NOW'        =&gt; $gm_buy_now, 
                              'PRODUCTS_SHIPPING_NAME'            =&gt; $shipping_status_name,
                              'PRODUCTS_SHIPPING_IMAGE'           =&gt; $shipping_status_image,
                              'PRODUCTS_DESCRIPTION'              =&gt; $array['products_description'],
                              'PRODUCTS_EXPIRES'                  =&gt; $array['expires_date'],
                              'PRODUCTS_CATEGORY_URL'             =&gt; $array['cat_url'],
                              'PRODUCTS_SHORT_DESCRIPTION'        =&gt; $array['products_short_description'],
                              'PRODUCTS_FSK18'                    =&gt; $array['products_fsk18'],
                              'GM_FORM_ACTION'                    =&gt; xtc_draw_form('gm_add_to_cart_'.$array['products_id'], xtc_href_link('index.php', 'action=buy_now&amp;BUYproducts_id=' . $array['products_id'] . $gm_cat_search, 'NONSSL', true, true, true), 'post', 'onsubmit="return gm_quantity_check_listing(\'' . $array['products_id'] . '\')"'),
                              'FORM_DATA'                         =&gt; $t_form_array,
                              'QTY_DATA'                          =&gt; $t_qty_array,
                              'PRODUCTS_Quantity_x'               =&gt; $array['products_quantity'],  
                              'GM_FORM_END'                       =&gt; '&lt;/form&gt;',
                              'GM_PRODUCTS_QTY'                   =&gt; $gm_qty,
                              'GM_PRODUCTS_STOCK'                 =&gt; $gm_products_stock,
                              'PRODUCTS_META_DESCRIPTION'         =&gt; $array['products_meta_description'],
                              'PRODUCTS_WEIGHT'                   =&gt; gm_prepare_number((double)$array['products_weight'], $xtPrice-&gt;currencies[$xtPrice-&gt;actualCurr]['decimal_point']),
                              'SHOW_PRODUCTS_WEIGHT'              =&gt; $array['gm_show_weight']);
  
  
      return $t_data_array;
      // EOF GM_MOD
  </code></pre>
  
  <p><br>
  Inside the html the following code is given<br></p>
  
  <pre><code>    &lt;span class="label"&gt;{$module_data.PRODUCTS_Quantity_x}&lt;span&gt;
  </code></pre>
  
  <p>I hope you can help me out here
  thanks in advance</p>