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:
parent
845a43338d
commit
e9f249bcde
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user