How to check if value is a number. If it is a number value display text center else text left. I want to know what is wrong with my statement.
 for (var l = 0; l < Object.keys(pods[i].data.summaryDetailedData).length; l++) {
    contentHtml += "<tr>";
    for (var m = 0; m < pods[i].data.columns.length; m++) {
        for (var field in pods[i].data.summaryDetailedData[l]) {
            var rowspan = (pods[i].data.summaryDetailedData[l].children !== undefined ? pods[i].data.summaryDetailedData[l].children.length : "");
            rowspanMax = Math.max(rowspanMax, rowspan);
            if (field === pods[i].data.columns[m]) {
                var preFix = pods[i].data.summaryDetailedData[l]["sPrefix"] !== undefined ? pods[i].data.summaryDetailedData[l]["sPrefix"] : "";
                var postFix = pods[i].data.summaryDetailedData[l]["sPostfix"] !== undefined ? pods[i].data.summaryDetailedData[l]["sPostfix"] : "";
                var value = pods[i].data.summaryDetailedData[l][field];
                if (value.toString().substr(0, 3) == "- 1") {
                    value = "N/A";
                }
                var color = pods[i].data.summaryDetailedData[l][field + "_color"];
                if (colName[m] === "sLabel" && pods[i].data.summaryDetailedData[l].bStepThrough == true) {
                    value = "<a href=\"#\" class=\"stepthrough\">" + value + "</a>";
                }
                color = color !== "" && color !== undefined ? " <span class=\"color\" style=\"background: #" + color + "\"></span>" : " <span class=\"color\"></span>";
                contentHtml += "<td rowspan1=\"" + 1 + "\" class=\"" + (rowspan !== "" && rowspan > 1 ? "groups" : "") + " " + (!isNaN(value) || (!isNaN(value.toString().substr(1, value.length)) || value == "N/A" || typeof value == Number) ? "text-center" : "text-left") + "\">" + value + (Number(value) ? preFix : "") + color + (!isNaN(value) ? postFix : "") + "</td>";
                if (rowspan > 1) {
                    var rowspanContent = "<td rowspa1=\"" + rowspan + "\" class=\"" + (rowspan !== "" && rowspan > 1 ? "groups" : "") + " " + (!isNaN(value) || (!isNaN(value.toString().substr(1, value.length)) || value == "N/A" || typeof value == Number) ? "text-center" : "text-left") + "\">" + value + (Number(value) ? preFix : "") + color + (!isNaN(value) ? postFix : "") + "</td>";
                }
                if (field === "sLabel") {
                    for (var child in pods[i].data.summaryDetailedData[l].children) {
                        if (child > 0 && rowspan >= 2) {
                            contentHtml += "</tr>";
                            contentHtml += "<tr>";
                            contentHtml += rowspanContent;
                        }
 
     
     
     
     
    