No apology necessary, you didn't do anything wrong. I know you addressed
your comment to the OP... my comment wasn't responding to your statement as
if you had addressed it to me... I was just noting that obviously I didn't
look up the function in the help files either (obvious from the fact that I
posted a more involved "RIGHT function with concatenation" solution that
didn't use the available optional argument... I thought that was kind of
funny. I don't have any occasion to use Hex/Decimal conversions, so I just
went with what the OP posted (assuming there was no built-in way of
specifying digits because he didn't use any) and posted my solution without
looking the function up for myself. I'm glad you came along and showed the
OP the correct way to solve his problem.
Ah. Now I see. When I posted my comment, I had not seen yours. And even
after, I didn't look at yours more closely. I just glanced at it and, seeing
the ...,2), I just quickly jumped to the conclusion that the "2" was the
optional argument for the dec2hex function, and completely missed that it was
the numchars argument for the right function.
Just goes to show how my bias affected what I saw.
--ron