Apr 3, 2014 #1 embpic Advanced Member level 3 Joined May 29, 2013 Messages 742 Helped 80 Reputation 160 Reaction score 77 Trophy points 1,308 Location india 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.
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.
Apr 3, 2014 #2 FvM Super Moderator Staff member Joined Jan 22, 2008 Messages 52,428 Helped 14,752 Reputation 29,786 Reaction score 14,105 Trophy points 1,393 Location Bochum, Germany Activity points 298,132 The internal numer format is binary. Strings can represent numbers in decimal or hexadecimal format.
Apr 3, 2014 #3 embpic Advanced Member level 3 Joined May 29, 2013 Messages 742 Helped 80 Reputation 160 Reaction score 77 Trophy points 1,308 Location india Activity points 5,213 yes but when i do Code: texbox1.text = decimalNumber.Tostring(); it shows only decimal number. - - - Updated - - - i wanna display hex number on textbox
yes but when i do Code: texbox1.text = decimalNumber.Tostring(); it shows only decimal number. - - - Updated - - - i wanna display hex number on textbox
Apr 3, 2014 #4 milind.a.kulkarni Advanced Member level 3 Joined Oct 6, 2011 Messages 922 Helped 214 Reputation 428 Reaction score 208 Trophy points 1,333 Location Bangalore Activity points 7,448 use Convert.ToDouble(String) first and then make that double to string should work refer - https://msdn.microsoft.com/en-us/library/bb397679.aspx Good Luck Milind
use Convert.ToDouble(String) first and then make that double to string should work refer - https://msdn.microsoft.com/en-us/library/bb397679.aspx Good Luck Milind
Apr 9, 2014 #5 B btbass Advanced Member level 5 Joined Jul 20, 2001 Messages 1,896 Helped 438 Reputation 880 Reaction score 288 Trophy points 1,363 Location Oberon Activity points 12,887 Try texbox1.text = decimalNumber.Tostring("X2");
Apr 12, 2014 #6 B btbass Advanced Member level 5 Joined Jul 20, 2001 Messages 1,896 Helped 438 Reputation 880 Reaction score 288 Trophy points 1,363 Location Oberon Activity points 12,887 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.
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.