Commit 35a76333 authored by Christopher Guess's avatar Christopher Guess
Browse files

added lookup for multipliers (thousand, hundred, score etc.)

parent ca1d9512
......@@ -45,7 +45,7 @@ Marka.prototype.match = function() {
var currencyWords = "(" + currencySymbols + "|kr|[Dd]ollars|[Cc]ents on the dollar|[Cc]ents|[Ee]uros|[Pp]ounds|[Rr]upees|[Zz]loty)";
var numbers = "[\\d,.]+";
var optSpace = "[\\s]*";
var magnitudes = "([Mm]illion|[Bb]illion|hundred thousand){0,1}";
var magnitudes = "([Mm]illion|[Bb]illion|[Hh]undred|[Tt]housand|[Tt]rillion|[Ll]akh|[Cc]rore|[Ss]core){0,1}";
var currencyCode = "[A-Z]{2,3}";
var optAsterisk = "[*]{0,1}";
var optBraceOpen = "[\(]{0,1}";
......@@ -98,12 +98,15 @@ Marka.prototype.splitSymbols = function(text) {
realnumber = parseFloat(number);
if (!realnumber) { return false; }
var residual = text.replace(numbers, "")
$.each(dollar_multiplier_lookup_table, function(property, value){
for(var property in dollar_multiplier_lookup_table){
value = dollar_multiplier_lookup_table[property];
var index = residual.search(property);
if(index > -1){
realnumber = realnumber * value;
residual = residual.replace(property, "");
}
});
};
var result = this.findSymbol(residual);
if (result.symbol == null) {
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment