1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-10 10:40:54 +00:00

adequately deal with mixed letter+number values in condition file

This commit is contained in:
Alain Pitiot 2019-07-08 10:02:51 +02:00
parent 845a43338d
commit e9f249bcde

View File

@ -370,10 +370,8 @@ export class TrialHandler extends PsychObject {
let value = row[l];
// if value is a numerical string, convert it to a number:
if (typeof value === 'string') {
const numericalValue = Number.parseFloat(value);
if (!Number.isNaN(numericalValue))
value = numericalValue;
if (typeof value === 'string' && !isNaN(value)) {
value = Number.parseFloat(value);
}
trial[fields[l]] = value;