Is there a way to validate/parse strings into integers when the characters used may use numeral character sets other than the standard Western 0-9?
Background: My Javascript application prompts users for integer input (their age), but some users answer using non-Western numerals due to their keyboard settings. Currently, those don't pass validation, but I'd like to accept and parse all valid integer responses, regardless of what numeral character set is used.
Desired behavior:
"12" => 12 // English/Western
"১৬" => 16 // Assamese
"२४" => 24 // Hindi
Is there a way to do this consistently without hardcoding all possible numeral sets explicitly?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/euaPzdn
Comments
Post a Comment