protected function parseAmountNegativeFormat($amount) {
    // An amount wrapped in parentheses.
    $amount = preg_replace('/^\((.*?)\)$/', '-\\1', $amount);
    // An amount suffixed by a minus sign.
    $amount = preg_replace('/^(.*?)-$/', '-\\1', $amount);
    // Double minus signs.
    $amount = preg_replace('/--/', '', $amount);

    return $amount;
  }
protected function parseAmountNegativeFormat($amount) {
    // An amount wrapped in parentheses.
    $amount = preg_replace('/^\((.*?)\)$/', '-\\1', $amount);
    // An amount suffixed by a minus sign.
    $amount = preg_replace('/^(.*?)-$/', '-\\1', $amount);
    // Double minus signs.
    $amount = preg_replace('/--/', '', $amount);

    return $amount;
  }
protected function parseAmountNegativeFormat ( $ amount ) { // An amount wrapped in parentheses. $ amount = preg_replace ( '/^\((.*?)\)$/' , '-\\1' , $ amount ) ; // An amount suffixed by a minus sign. $ amount = preg_replace ( '/^(.*?)-$/' , '-\\1' , $ amount ) ; // Double minus signs. $ amount = preg_replace ( '/--/' , '' , $ amount ) ; return $ amount ; }
Parses a negative amount.

@param string $amount

@return string
The amount with negative formatting replaced by a minus sign prefix.
Parses a negative amount .