JSFiddle - React, Tailwind, and code Playground
by Dogbert
HTML
<div id="price">
1_0:12.0621665506843,1,lbs,1,13.00; 38.0422175829274,5.50,lbs,5.50,41.00; 76.0844351658548,8.5,lbs,8.5,82 ;126.188819299466,15.00,lbs,15.00,136.00; 224.541869635815,30.00,lbs,30.00,242.00
</div>
CSS
#price {
white-space: pre;
}
JavaScript
var $price = $("#price");
var input = $price.text();
var output = input.trim().replace(/^.*?:/, '').split(';').map(function(x) {
x = x.trim().split(',').map(s => s.trim());
return ["pre-tax: $" + (+x[0]).toFixed(2),
"qty: " + x[1],
"unit: " + x[2],
"qty-2: " + x[3],
"with-tax: " + (+x[4]).toFixed(2)].join("\n") + "\n"
}).join('\n');
$price.text(output);