Every line of 'jquery string to number' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
2740 function toNumber (str) { 2741 return parseInt(str, 10) 2742 }
5 function toNumber(s: any): number { 6 return +s; 7 }
1 function number(input: string | number): number { 2 if (typeof input === 'string') { 3 return parseInt(input.replace(/^\D+/g, ''), 10); 4 } 5 6 return 0; 7 }
42 function getNumber (str) { 43 str = str.replace(/(invert)|(brightness)|(blur)|(contrast)|(grayscale)|(sepia)|(threshold)|(gamma)?\(/g, '').replace(')', '') 44 if (str.indexOf('%') !== -1) { 45 return Number(str.replace('%', '')) / 100 46 } else if (str.indexOf('px') !== -1) { 47 return Number(str.replace('px', '')) 48 } else { 49 return Number(str) 50 } 51 }
8 export function parseNumber(s) { 9 s = String(s).replace(/[^\d-.]/g, '').replace(/\.$/, ''); 10 if (!s.match(NUMBER_RE)) { return null; } 11 return parseFloat(s, 10); 12 }
12 function makeNumber(v) { 13 return parseFloat(v.replace(/[$,]/g, ''), 10); 14 }
6 function Number(value) { 7 return +value; 8 }
505 function number(n) { 506 if (n instanceof tree.Dimension) { 507 return parseFloat(n.unit.is('%') ? n.value / 100 : n.value); 508 } else if (typeof(n) === 'number') { 509 return n; 510 } else { 511 throw { 512 error: "RuntimeError", 513 message: "color functions take numbers as parameters" 514 }; 515 } 516 }
39 export function ToInt(stringOrFloatVal) { return parseInt(stringOrFloatVal); }
5 export function toNumber(value: string): number { 6 return parseInt(value, 10); 7 }