-2

I converted characters into hexadecimal format But it looks ugly how to provide the formatted way.

Thank you.

  • 1
    what have you tried so far? do you know how to write good questions? http://stackoverflow.com/help/how-to-ask – Martin Frank Sep 16 '14 at 06:01
  • my question is not duplicated and i updated my code also and remove the question as duplicated.@StanislavL – user3531731 Sep 16 '14 at 07:15
  • you have a simple formatting issue - it's not a problem with conversion... maybe you can ask a new question or ask if the Administrator helps you out to redisgn your question - http://stackoverflow.com/help/reopen-questions – Martin Frank Sep 16 '14 at 07:29

1 Answers1

0

something like this could help:

char ch = 'a';
String hex = String.format("%04x", (int) ch);
tf.setText(hex);