Use Min and Max to avoid going outside 0-100 for PrecentType. This fixed #1014
Merge pull request #1034 from jarlebh/master

Avoid going outside 0-100 for PrecentType. This fixes #1014