diff --git a/src/lib/plugins/commands.js b/src/lib/plugins/commands.js index 8de032b..835807c 100644 --- a/src/lib/plugins/commands.js +++ b/src/lib/plugins/commands.js @@ -296,8 +296,8 @@ module.exports.server = function(serv) { }; serv.posFromString = (str, pos) => { - if (parseInt(str)) return parseInt(str); - if (str.match(/~-?\d+/)) return parseInt(str.slice(1)) + pos; + if (str.indexOf("~")==-1) return parseFloat(str); + if (str.match(/~-?\d+/)) return parseFloat(str.slice(1)) + pos; else if (str == '~') return pos; else throw new UserError('Invalid position'); };