Archived
2

parse spectra to float

This commit is contained in:
VLE2FE 2020-08-21 11:23:36 +02:00
parent 092c547fff
commit 47955ec572

View File

@ -7,8 +7,8 @@ export default function flatten (data, keepArray = false) { // flatten object:
result[prop] = cur; result[prop] = cur;
} }
else if (prop === `${globals.spectrum.spectrum}.${globals.spectrum.dpt}`) { else if (prop === `${globals.spectrum.spectrum}.${globals.spectrum.dpt}`) {
result[prop + '.labels'] = cur.map(e => e[0]); result[prop + '.labels'] = cur.map(e => parseFloat(e[0]));
result[prop + '.values'] = cur.map(e => e[1]); result[prop + '.values'] = cur.map(e => parseFloat(e[1]));
} }
else if (Array.isArray(cur)) { else if (Array.isArray(cur)) {
if (keepArray) { if (keepArray) {