loading...

re: Daily Challenge #158 - RGB To Hex Conversion VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Note that you can use a format string to do most of the work for you: # before valid_num(v).to_s(16).rjust(2, '0') # after "%02X" % valid_num(n)...
 

Thanks for the tip! I've mostly used string formating for dealing with point numbers in decimals. Need to explore more use cases because the syntax is indeed preferable.

Code of Conduct Report abuse