public function parseCurrency($value, CurrencyInterface $currency)
{
$replacements = [$this->numberFormat->getDecimalSeparator() => '.', $this->numberFormat->getPlusSign() => '+', $this->numberFormat->getMinusSign() => '-', $this->numberFormat->getGroupingSeparator() => '', $currency->getCurrencyCode() => '', $currency->getSymbol() => '', ' ' => '', chr(0xc2) . chr(0xa0) => ''];
$numberingSystem = $this->numberFormat->getNumberingSystem();
if (isset($this->digits[$numberingSystem])) {
// Convert the localized digits back to latin.
$replacements += array_flip($this->digits[$numberingSystem]);
}
$value = strtr($value, $replacements);
if (substr($value, 0, 1) == '(' && substr($value, -1, 1) == ')') {
// This is an accounting formatted negative number.
$value = '-' . str_replace(['(', ')'], '', $value);
}
return is_numeric($value) ? $value : false;
}