Skip to content

Commit

Permalink
parseFloat numerical metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Forrest Oliphant committed Apr 16, 2015
1 parent b0d04e1 commit a5fc904
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion grammar/fbp.peg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
if (item.length === 1) {
item = ['routes', item[0]];
}
metadata[item[0]] = item[1];
var key = item[0];
var value = item[1];
if (key==='x' || key==='y') {
value = parseFloat(value);
}
metadata[key] = value;
}
nodes[nodeName].metadata=metadata;
}
Expand Down

0 comments on commit a5fc904

Please sign in to comment.