Fix percent function to return minimum zero

The percent function is used for ui-bars. When returning numbers below zero the bar will show up with 100% width, 'cause css don't know negative width. Issue #3886