BNolet / RLC

GNU Affero General Public License v3.0
12 stars 12 forks source link

Number to word converter failing #106

Open Stjerneklar opened 8 years ago

Stjerneklar commented 8 years ago

v.2.29 fails

console log:

v.2.29 v. two. two9

Stjerneklar commented 8 years ago

Kretenkobr2 : Stjerneklar I am pretty sure that is the pattern, the same number before and after the dot

Stjerneklar commented 8 years ago

seems like the number after the number after the dot must be different?

LewisMCYoutube commented 8 years ago

Error in number to English function.

kretenkobr2 commented 8 years ago

OK here is everything we know i one place for better readability, I hope it helps:

1) When numbers are split by anything, be it dot, comma or space, & the number between and after the split are the same(like in 2.29), it reads numbers wrong, and after the spit reads digit by digit(two dot two nine, and it should read two dot twentynine).

2) Our numberToEnglish system is in south Asian numbering system.

3) The problem lies in the way we split numbers into chunks to read, as opposed to numberToEnglish function, since we replaced numberToEnglish function multiple times with different copy-pastes from different sources and it still wouldn't work. This is current split-join part:

var numbermatches = getNumbers(linetoread);

            $.each(numbermatches, function(i) {
                linetoread = linetoread.split(numbermatches[i]).join(numberToEnglish(numbermatches[i]));
            });
LewisMCYoutube commented 8 years ago

change the way numbers are split?