refactored formatters from https://github.com/symfony/symfony/blob/69deac3014940031825238a407be4674cfdeb8fb/src/Symfony/Component/Validator/ConstraintValidator.php