@format_field.register(u'<STR_LIT:x>')<EOL>@format_field.register(u'<STR_LIT:X>')<EOL>def format_hexadecimal_field(spec, prec, number, locale):
if number < <NUM_LIT:0>:<EOL><INDENT>number &= (<NUM_LIT:1> << (<NUM_LIT:8> * int(math.log(-number, <NUM_LIT:1> << <NUM_LIT:8>) + <NUM_LIT:1>))) - <NUM_LIT:1><EOL><DEDENT>format_ = u'<STR_LIT>' % (int(prec or <NUM_LIT:0>), spec)<EOL>return format(number, format_)<EOL>
Formats a hexadeciaml field.