<?php print (int) $instance['num_post']; ?>
or possibly:
<?php print absint( $instance['num_post'] ); ?>
Use the second one to avoid negative values.
<?php print (int) $instance['num_post']; ?>
or possibly:
<?php print absint( $instance['num_post'] ); ?>
Use the second one to avoid negative values.