By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,769 Members | 1,589 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,769 IT Pros & Developers. It's quick & easy.

byte.toString("X") always return 2 characters

P: n/a
Hello,

with byte.toString("X"), if the decimal value of the byte is <16, then that
return opnly one character.
Is it possible (with a short things like another formatprovider than "X") to
always have the result on 2 characters, with the first 0 in this case

Thx
May 16 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ToString("0X")

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Geoffrey" <AE**************@dufour.be> wrote in message
news:Of*************@TK2MSFTNGP02.phx.gbl...
Hello,

with byte.toString("X"), if the decimal value of the byte is <16, then
that
return opnly one character.
Is it possible (with a short things like another formatprovider than "X")
to
always have the result on 2 characters, with the first 0 in this case

Thx

May 16 '06 #2

P: n/a


Geoffrey wrote:

with byte.toString("X"), if the decimal value of the byte is <16, then that
return opnly one character.
Is it possible (with a short things like another formatprovider than "X") to
always have the result on 2 characters, with the first 0 in this case


byte.ToString("X2")
is probably what you are looking for.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
May 16 '06 #3

P: n/a
Thx

"Martin Honnen" <ma*******@yahoo.de> a écrit dans le message de
news:%2****************@TK2MSFTNGP03.phx.gbl...


Geoffrey wrote:

with byte.toString("X"), if the decimal value of the byte is <16, then that return opnly one character.
Is it possible (with a short things like another formatprovider than "X") to always have the result on 2 characters, with the first 0 in this case


byte.ToString("X2")
is probably what you are looking for.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

May 16 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.