1. number_format() adds commas to the number and thus you won't be able to use it correctly in mathematic operations. So don't number_format() $boardviews[totalviews] or $countviews[views] before calculating $percentviews.
2. This:
Code:
SELECT [high]count[/high](views) AS views FROM thread WHERE postuserid='$bbuserinfo[userid]'
should have [high]SUM[/high] as well.