| Server IP : 85.158.181.41 / Your IP : 216.73.217.12 Web Server : Apache System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64 User : moncbefd ( 1024) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/moncbefd/www.moneta.at/gm/inc/ |
Upload File : |
<?php
/* --------------------------------------------------------------
gm_convert_qty.inc.php 2013-12-17 gm
Gambio GmbH
http://www.gambio.de
Copyright (c) 2013 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
*/
function gm_convert_qty($p_number, $p_force_point = true)
{
static $t_decimal_point;
$t_formatted_number = $p_number;
if($p_force_point)
{
$t_formatted_number = str_replace(',', '.', (string)$t_formatted_number);
}
$t_formatted_number = (double)$t_formatted_number;
if($p_force_point === false)
{
if($t_decimal_point === null)
{
$t_decimal_point = ',';
$t_sql = 'SELECT decimal_point FROM currencies WHERE code = "' . xtc_db_input($_SESSION['currency']) . '" LIMIT 1';
$t_result = xtc_db_query($t_sql);
if(xtc_db_num_rows($t_result) == 1)
{
$t_result_array = xtc_db_fetch_array($t_result);
$t_decimal_point = $t_result_array['decimal_point'];
$t_formatted_number = str_replace('.', $t_decimal_point, $t_formatted_number);
}
else
{
$t_formatted_number = str_replace('.', $t_decimal_point, $t_formatted_number);
}
}
else
{
$t_formatted_number = str_replace('.', $t_decimal_point, $t_formatted_number);
}
}
return $t_formatted_number;
}