title: How to get a hex value from a decimal integer in Java?
body: <p>I don't know how to generate a hex "0x83" character from an integer value in Java.</p>
  
  <p>I need a "0x83" value to represent a letter in the Cyrillic alphabet (this letter: <strong>ѓ</strong>), in order to send it (the letter) to my printer. When converting 131 (0x83 in decimal) into hex with my converter (below) I get three numbers: 0x31, 0x33 and 0x31.</p>
  
  <pre><code>public String toHex(String arg) {
      return String.format("%x", new BigInteger(arg.getBytes()));
  }
  </code></pre>
  
  <p>I need to get 0x83 from this conversion. </p>