question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IsCurrency symbol validation error

See original GitHub issue

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: 'R$',
	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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
vlapocommented, Jul 21, 2020

@btd1337 now we have to update validato.js 😃 I will try release new version with updated dependencies soon.

0reactions
NoNameProvidedcommented, Dec 9, 2022

Closing this as expired. If you still encounter this error please open a new issue with a minimal reproducible example showcasing your problem. The example should:

  • be as short as possible while clearly showcasing the problem
  • has no external dependencies, only this lib
  • the expected and actual behavior should be explained
Read more comments on GitHub >

github_iconTop Results From Across the Web

Client Validation Error With Input Fields Containing Currency ...
The problem is when the form goes in edit mode,the client validation throws the following error since the input field contains the currency...
Read more >
Client Validation Error With Input Fields Containing ... - MSDN
The problem is when the form goes in edit mode,the client validation throws the following error since the input field contains the currency...
Read more >
Validation Errors Despite No Validation Rule?
The first validation error encountered was: Currency ISO Code: invalid currency code: ". " There are no validation rules on object! apex ...
Read more >
Using multiple currency setup in SalesForce, an error ...
... an error message occurs when saving incident records: Validation Errors ... the error encountered was "currency ISO Code: invalid currency code: Euro"....
Read more >
Required Error Codes for MX Validation - IBM
Invalid active or historic currency code. Sw.Stds.D00007, Invalid Currency Amount. Also, the number of fractional digits (or minor unit of currency) must comply ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found