Cast int value for port