conversion of number's in C#

Status
Not open for further replies.

embpic

Advanced Member level 3
Joined
May 29, 2013
Messages
742
Helped
80
Reputation
160
Reaction score
77
Trophy points
1,308
Location
india
Visit site
Activity points
5,213
i am getting problem while converting decimal number to hexadecimal number. i am doing small tool for timer delay calc.
so how to convert decimal to hex and hex to decimal.
 

The internal numer format is binary. Strings can represent numbers in decimal or hexadecimal format.
 

yes but when i do
Code:
texbox1.text = decimalNumber.Tostring();
it shows only decimal number.

- - - Updated - - -

i wanna display hex number on textbox
 

No response, so I will elaborate?

texbox1.text = decimalNumber.Tostring("X2");

Formatting string: X = uppercase hex digits, 2 = 2 hex digits.

texbox1.text = decimalNumber.Tostring("x4");

Formatting string: x = lowercase hex digits, 4 = 4 hex digits.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…