JSFiddle - React, Tailwind, and code Playground
by askhflajsf
HTML
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://rawgit.com/evanplaice/jquery-csv/master/src/jquery.csv.min.js"></script>
<h1>New CSV</h1>
<pre class="new"></pre>
<h1>Original CSV</h1>
<pre class="original"></pre>
JavaScript
var originalCsv = `1366383202,748.680000000000,1.000000000000
1366471506,777.440000000000,2.700000000000
1368121200,685.740000000000,2.187400000000
1375783458,619.500000000000,1.000000000000`
// Parse multi-line CSV string into a 2D array
// https://github.com/evanplaice/jquery-csv
var newCsvTemp = $.csv.toArrays(originalCsv);
// jquery-csv's arrays are made up of strings, but we need them to be numbers
// Trim whitespace and then convert to Number
var newCsv = newCsvTemp.map(row => row.map(el => Number(el.trim())));
// Multiply amount traded with price
var newCsvMultiplied = newCsv.map(row => [row[0], row[1], row[1] * row[2]]);
$(".new").text($.csv.fromObjects(newCsvMultiplied));
$(".original").text(originalCsv);