Zero padded hexadecimal numbers in Java


Notice: A non well formed numeric value encountered in /home/yeezil/javver.com/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /home/yeezil/javver.com/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

A quick recipe, converting an int or long like 65 to a string like 000041. It’s useful for converting integer RGB colors to the common #FFBBCC kind of web encoded colors.

 

:>