JSFiddle - React, Tailwind, and code Playground

by alr3

HTML

<div class="test"></div>

JavaScript

var hoursString = "4.3|2.4|3.4|3.0|2.64|3.0|1.0|0.0|2.6|3.4|"
var hours=hoursString.split("|");

var total=0;
var idx = 0;
for(idx in hours) {
    total += +hours[idx];
}

alert(total);