This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric/1830844#1830844 | |
function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } | |
// Check if character is a fraction, e.g. ¼ | |
function isFractionalChar(n) { | |
c = n.charCodeAt(); | |
return (c >= 188 && c <= 190) || (c >= 8531 && c <= 8542); | |
} | |
// return the first fractional character in a string |