This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

changing hex value to decimal

hi,

how to change the value of hex to decimal

For example from hex "0x15" to decimal 15 or in hex like 0x0f.

do we have any option in keil or any other way.

Thankyou

arun.

Parents
  • "how to change the value (sic) of hex to decimal"

    The value of a number (or a variable) is the same irrespective of what format you express it in!

    eg, 0x15 (hex) has the same value as 21 (decimal) which has the same value as 25 (octal) has the same value as 10101 (binary) has the same value as XXI (roman numerals)

    Presumably, what you mean is to convert the value of a variable into text for printing or display or similar - yes?

    If so, think about what standard 'C' library functions perform conversions of numbers to formatted text...

    Or, if you want to code it yourself, think about how you would do this manually - using pencil and paper...

Reply
  • "how to change the value (sic) of hex to decimal"

    The value of a number (or a variable) is the same irrespective of what format you express it in!

    eg, 0x15 (hex) has the same value as 21 (decimal) which has the same value as 25 (octal) has the same value as 10101 (binary) has the same value as XXI (roman numerals)

    Presumably, what you mean is to convert the value of a variable into text for printing or display or similar - yes?

    If so, think about what standard 'C' library functions perform conversions of numbers to formatted text...

    Or, if you want to code it yourself, think about how you would do this manually - using pencil and paper...

Children