# HG changeset patch # User Fadi Abbud # Date 1568900002 -7200 # Node ID a075da82e875844ea95947671507c4130e739028 # Parent a66275cf449099e703a63028d0388cb65a7de55a client:FWD: change unit to meter for the generated csv file diff -r a66275cf4490 -r a075da82e875 client/src/store/fairwayavailability.js --- a/client/src/store/fairwayavailability.js Thu Sep 19 12:50:49 2019 +0200 +++ b/client/src/store/fairwayavailability.js Thu Sep 19 15:33:22 2019 +0200 @@ -192,8 +192,14 @@ // See docs/developers.md for an example how to directly // call this method for testing. setAvailableFairwayDepthData: (state, data) => { - state.csv = data; - const csv = data.split("\n").filter(x => x !== ""); //omit empty lines + const lines = data.split("\n"); + let [header, rest] = [lines.shift(), lines]; + // convert values to meter in the csv header + state.csv = [ + header.replace(/\d+\.?\d*/g, x => `${x / 100}m`), + ...rest + ].join("\n"); + const csv = [header, ...rest].filter(x => x !== ""); //omit empty lines // setLegend const headerEntries = csv.shift().split(",");