[SOLVED] Custom message for .number() / . string() etc (without additional parameters)
See original GitHub issue numberField: Yup.number("Not a numbBar")
.integer("Please enter a whole number")
.required("Please enter price, enter 0 for a free class"),
Cannot seem to find in docs how to display a custom message, for .number()?
1 - number; 2 - integer; 3 - required. 2 and 3 works as expected.
3 - .number() returns this:
numberField must be a
numbertype, but the final value was:
NaN(cast from the value
"foobar ").
Would like to return a custom message
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Custom Excel number format - Ablebits
This tutorial explains the basics of the Excel number format and provides the detailed guidance to create custom formatting.
Read more >HTML5 form required attribute. Set custom validation message?
So I set the pattern attribute to check for numbers and optional decimals which gives the message, "Please match the requested format," on...
Read more >Java Generics Example Tutorial - Generic Method, Class ...
Above code compiles fine but throws ClassCastException at runtime because we are trying to cast Object in the list to String whereas one...
Read more >6 Ways to Fix Dates Formatted as Text in Excel
No mention of the Text() function to convert the numeric value to a string? Big omission. Reply. Mynda Treacy. September 21, 2019 at...
Read more >JavaScript language overview - MDN Web Docs
The Number() function, which parses a string as if it's a number literal ... Number values also include NaN (short for "Not a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
.typeError()
I believe is the method for setting thatamount: Yup.number().typeError(“Must be a number”),