I would go this way:
decimal value = 17m; // or YourNumericUpDownControl.Value
int percent = (int)Math.Round(((value / 100) * 256) - 1, MidpointRounding.ToEven);
string hex = percent.ToString("X");
NumericUpDown.Value
is of type decimal
(see MSDN), so you should start with a decimal
. I've entered 17 here directly, as you did in your example.