Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsCurrency symbol validation error #1292

Closed
btd1337 opened this issue May 4, 2020 · 2 comments · Fixed by #1306
Closed

IsCurrency symbol validation error #1292

btd1337 opened this issue May 4, 2020 · 2 comments · Fixed by #1306
Labels

Comments

@btd1337
Copy link

btd1337 commented May 4, 2020

Hi devs,

I'm trying use BRL currency in @IsCurrency options, but when I use this setting the validator fails:

{
	symbol: 'R$',
	require_symbol: true,
	allow_space_after_symbol: true,
	symbol_after_digits: false,
	allow_negatives: false,
	parens_for_negatives: false,
	negative_sign_before_digits: false,
	negative_sign_after_digits: false,
	allow_negative_sign_placeholder: false,
	thousands_separator: '.',
	decimal_separator: ',',
	allow_decimal: true,
	require_decimal: true,
	digits_after_decimal: [2],
	allow_space_after_digits: false,
}

Value: R$ 1.400,00

"statusCode": 400,
    "message": [
        "monthyMoneyGoal must be a currency"
    ],
    "error": "Bad Request"

But changing symbol to $ it works:

{
	symbol: '$',
	require_symbol: true,
	allow_space_after_symbol: true,
	symbol_after_digits: false,
	...
}

Value: $ 1.400,00

"statusCode": 200,
    "message": [
        "Successful update"
    ],

Changing symbol to $R it unbelievably too works!

Why? Where is error?

PS: My app uses single quotes in Prettier Formatter

@profnandaa
Copy link
Member

profnandaa commented May 5, 2020

Thanks for raising! PR welcome.

@islasjuanp
Copy link
Contributor

Hi @profnandaa ,
I was able reproduce it on a unit test. I would be glad of working on this issue if it still open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants