title: how to format hex numbers using stringstream
body: <p>I am trying to convert an unsigned short to its hexadecimal representation in uppercase and prefixed with 0's using stringstream. I can't seem to get the uppercase and 0's correct. here is what I have now:</p>
  
  <pre><code>USHORT id = 1127;
  std::stringstream ss;
  ss &lt;&lt; std::showbase &lt;&lt; std::uppercase &lt;&lt; std::setfill('0') &lt;&lt; std::setw(4) &lt;&lt; std::hex &lt;&lt; id;
  std::string result = ss.str();
  </code></pre>
  
  <p>this results in the prefixed '0x' base also being uppercase but I want that to be lowercase. it also results in no prefixed 0's to the hexadecimal value after the prefixed 0x base (currently 0X). for example, this will now output 0X467 instead of the expected 0x0467. how do I fix this?</p>