currency parser update: detect with +/- symbols

This commit is contained in:
Mottie 2014-02-18 12:40:10 -06:00
parent fc6d0961b0
commit 5f366762f7

View File

@ -1488,7 +1488,7 @@
ts.addParser({ ts.addParser({
id: "currency", id: "currency",
is: function(s) { is: function(s) {
return (/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/).test((s || '').replace(/[,. ]/g,'')); // £$€¤¥¢ return (/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/).test((s || '').replace(/[+\-,. ]/g,'')); // £$€¤¥¢
}, },
format: function(s, table) { format: function(s, table) {
var n = ts.formatFloat((s || '').replace(/[^\w,. \-()]/g, ""), table); var n = ts.formatFloat((s || '').replace(/[^\w,. \-()]/g, ""), table);