What can i do about a price what is written in 1,00 instead of 1.00 if i pars it the price is 100.00 :)
THX
HEnk
Hi Henk,
This will require a mod to the decimalise function, which I think is worth incorporating into the distribution, so i'll do that. In the file includes/tapestry.php, alter the function:
function tapestry_decimalise($price) { $price = preg_replace('/[^0-9\.]/e','',$price); $price = sprintf("%.2f",$price); return $price; }
...so that it does a search and replace on "," for ".", and allows "," through the filter:
function tapestry_decimalise($price) { $price = str_replace(",",".",$price); $price = preg_replace('/[^0-9\.]/e','',$price); $price = sprintf("%.2f",$price); return $price; }
..it should then work...
Correction - there was no need for the comma in the regular expression; but it shouldn't have made any difference.
©2006-2025 IAAI Software | Contact Us | Privacy Policy
Hi Henk,
This will require a mod to the decimalise function, which I think is worth incorporating into the distribution, so i'll do that. In the file includes/tapestry.php, alter the function:
function tapestry_decimalise($price)
{
$price = preg_replace('/[^0-9\.]/e','',$price);
$price = sprintf("%.2f",$price);
return $price;
}
...so that it does a search and replace on "," for ".", and allows "," through the filter:
function tapestry_decimalise($price)
{
$price = str_replace(",",".",$price);
$price = preg_replace('/[^0-9\.]/e','',$price);
$price = sprintf("%.2f",$price);
return $price;
}
..it should then work...