Click here to Skip to main content
15,913,027 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: multi form in the same form Pin
Christian Graus8-Feb-07 13:06
protectorChristian Graus8-Feb-07 13:06 
GeneralRe: multi form in the same form Pin
Hasan Jaffal8-Feb-07 22:01
Hasan Jaffal8-Feb-07 22:01 
GeneralRe: multi form in the same form Pin
M-Hall10-Feb-07 7:10
M-Hall10-Feb-07 7:10 
QuestionSetting Readonly on columns in Datagrid in the code behind Pin
BitterChick8-Feb-07 11:38
BitterChick8-Feb-07 11:38 
AnswerRe: Setting Readonly on columns in Datagrid in the code behind Pin
gauthee8-Feb-07 18:02
gauthee8-Feb-07 18:02 
QuestionDataGridView formatting breaks validation Pin
penguin50008-Feb-07 11:25
penguin50008-Feb-07 11:25 
AnswerRe: DataGridView formatting breaks validation Pin
penguin500020-Jul-07 10:56
penguin500020-Jul-07 10:56 
QuestionConverting huge numbers for Decimal to Hexadecimal and visa versa Pin
Fu Manchu8-Feb-07 11:19
Fu Manchu8-Feb-07 11:19 
Hi all,Smile | :)

i have been trying to create some function that take the Decimal datatype to convert decimal to hexadecimal and the reverse.

my code at present uses the long datatype which go up to 9.2 E+18. Currently i am working with larger numbers.

This is my code:

Private Function ConvertDecimalToHexadecimal(ByVal number As Decimal)<br />
        Dim converted As String<br />
        Dim value As Long = Long.Parse(number)<br />
        converted = value.ToString("X")<br />
        Return converted<br />
    End Function


Private Function ConvertHexadecimalToDecimal(ByVal number As String)<br />
<br />
        Dim txt As String<br />
        Dim value As Decimal<br />
        Dim converted As String<br />
<br />
        txt = UCase(Trim(number))<br />
        If txt.StartsWith("&H") Then txt = txt.Substring(2)<br />
        value = long.Parse(txt, Globalization.NumberStyles.HexNumber)<br />
        converted = value.ToString()<br />
        Return converted<br />
<br />
    End Function


Is there some way of making this work for numbers up to the decimal datatype of 1.79 E+308

or if anyone knows of another way?

Thanks
AnswerRe: Converting huge numbers for Decimal to Hexadecimal and visa versa Pin
Johan Hakkesteegt8-Feb-07 22:26
Johan Hakkesteegt8-Feb-07 22:26 
AnswerRe: Converting huge numbers for Decimal to Hexadecimal and visa versa [modified] Pin
TwoFaced9-Feb-07 16:28
TwoFaced9-Feb-07 16:28 
Questionenumerate objects Pin
RJGCarey8-Feb-07 9:17
RJGCarey8-Feb-07 9:17 
AnswerRe: enumerate objects Pin
Christian Graus8-Feb-07 9:27
protectorChristian Graus8-Feb-07 9:27 
GeneralRe: enumerate objects Pin
RJGCarey9-Feb-07 2:55
RJGCarey9-Feb-07 2:55 
GeneralRe: enumerate objects Pin
Christian Graus9-Feb-07 9:51
protectorChristian Graus9-Feb-07 9:51 
Questionvba script to monitor temperature and workgroup Pin
tomboy788-Feb-07 7:08
tomboy788-Feb-07 7:08 
Questioninstance of form Pin
charchabil038-Feb-07 6:35
charchabil038-Feb-07 6:35 
AnswerRe: instance of form Pin
MatrixCoder8-Feb-07 6:41
MatrixCoder8-Feb-07 6:41 
GeneralRe: instance of form Pin
charchabil038-Feb-07 7:11
charchabil038-Feb-07 7:11 
GeneralRe: instance of form Pin
Old John8-Feb-07 15:23
Old John8-Feb-07 15:23 
AnswerRe: instance of form [modified] Pin
TwoFaced8-Feb-07 7:42
TwoFaced8-Feb-07 7:42 
GeneralRe: instance of form Pin
charchabil0310-Feb-07 5:51
charchabil0310-Feb-07 5:51 
GeneralRe: instance of form Pin
TwoFaced10-Feb-07 7:10
TwoFaced10-Feb-07 7:10 
GeneralRe: instance of form Pin
charchabil0310-Feb-07 21:16
charchabil0310-Feb-07 21:16 
QuestionClosing a form Pin
jady848-Feb-07 5:51
jady848-Feb-07 5:51 
AnswerRe: Closing a form Pin
M-Hall8-Feb-07 6:21
M-Hall8-Feb-07 6:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.