You can use a validation rule instead of the if/else sequence like this:

```php
$validAmountUsingDot = v::regex('/^[0-9,]+(\.[0-9]{1,2})?$/');
$validAmountUsingComma = v::regex('/,[0-9]{2}$/');
if (false === v::oneOf($validAmountUsingDot, $validAmountUsingComma)->validate($amount)) {
    $this->addError('Amount', $this->AMOUNT_BAD_FORMAT);
}
```