Skip to content
Code-Schnipsel Gruppen Projekte
Commit f04d96fe erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen
Übergeordneter 4f9ef9bb
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -176,9 +176,10 @@ public function getCurrency(): QUI\ERP\Currency\Currency
* Validates a price value
*
* @param int|float|string $value
* @param QUI\Locale|null $Locale - based locale, in which the price is
* @return float|int|null
*/
public static function validatePrice($value)
public static function validatePrice($value, $Locale = null)
{
if (\is_float($value)) {
return \round($value, QUI\ERP\Defaults::getPrecision());
......@@ -194,14 +195,18 @@ public static function validatePrice($value)
return null;
}
if ($Locale === null) {
$Locale = QUI::getSystemLocale();
}
$negativeTurn = 1;
if ($isNegative) {
$negativeTurn = -1;
}
$decimalSeparator = QUI::getSystemLocale()->getDecimalSeparator();
$thousandSeparator = QUI::getSystemLocale()->getGroupingSeparator();
$decimalSeparator = $Locale->getDecimalSeparator();
$thousandSeparator = $Locale->getGroupingSeparator();
$decimal = \mb_strpos($value, $decimalSeparator);
$thousands = \mb_strpos($value, $thousandSeparator);
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren