let parseNumber = (n: any): number | null => !n ? 0 : Number(n); code example
Example: typescript string to number
var x = "32";
var y: number = +x;//the "+" converts string to number
var x = "32";
var y: number = +x;//the "+" converts string to number