Fixing JSHint code and some optimization

Just some fix to pass jshint check and a little optimization. Now it already parse the string and then if it is in the formar 99.99.9999 parses again.