Back to PhocacartUtils class

Method replaceCommaWithPoint

public static
replaceCommaWithPoint
(mixed $item)

Method replaceCommaWithPoint - Source code

public static function replaceCommaWithPoint($item)
{
    $paramsC = PhocacartUtils::getComponentParameters();
    $comma_point = $paramsC->get('comma_point', 0);
    $item = PhocacartUtils::getDecimalFromString($item);
    if ($comma_point == 1) {
        return str_replace(',', '.', $item);
    } else {
        return $item;
    }
}