remove comma if it's the last character and tolerance done right