calculating the value from percent