Jump to content
Tuts 4 You

Hexidecimal to Decimal


zorke

Recommended Posts

Hi :)

Recently i've started a project which requires displaying output as a decimal number in ASCII characters.

I've done the Hex value - to - ascii char thing but conversion of the number ... say - 2012 from hex (which is 0x07dc)

to a decimal number displayed on the screen (2012) is a bit more difficult.

Example : eax == 07dc i want to display in a messagebox the decimal value of eax. how do i make it decimal?

Thanks

Link to comment

Here is a function of me coded for Delphi performing that task, I hope it could be helpful:

function IntegerToString(Quantity: Int64): String;
var
Remainder: Integer;
begin
Result := '';
Repeat
Remainder := Quantity MOD 10;
Result := Chr(Remainder + Ord('0')) + Result;
Quantity := Quantity DIV 10;
until Quantity = 0;
end;
Edited by Nacho_dj
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...