fix endless while cycles that appear when using locales that do not use a thousands separator at all (such is the case with Latvian, Croatian, Polish, Dutch and many other locales)