Javascript concatenating numbers, not adding up
问题 It keeps concatenating my numbers into 2111 instead of 5. Why is this? I've tried using parseInt with no luck. res3 btw represents a query into my database that I'm executing. var dt_total_hours = 0; dt_total_hours += res3.fieldByName(dt_cost_per_hour); dt_total_hours += res3.fieldByName(dt_prod_dt_hours); dt_total_hours += res3.fieldByName(dt_prod_rate); dt_total_hours += res3.fieldByName(dt_cost_per_unit); dt_total_hours += res3.fieldByName(dt_scrap_startup_cost); dt_total_hours += res3