fixes #6171 Need improbe the decimal validation

Fixed the issue and committed the code for review, please check it.