Recent

Author Topic: hex to dec (and vice versa) in Linux  (Read 3101 times)

Osvaldo Arruda

  • New Member
  • *
  • Posts: 27
hex to dec (and vice versa) in Linux
« on: October 18, 2012, 11:52:43 pm »
I need some function that converts hex to dec and vice versa operating only strings. For use on Linux.

Thanks all

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: hex to dec (and vice versa) in Linux
« Reply #1 on: October 18, 2012, 11:57:08 pm »
inttostr, inttohex and strtoint do exactly that. Just make sure that the hex number has a dollar sign in front of the value eg $AD instead of AD and strtoint will convert that to an integer.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: hex to dec (and vice versa) in Linux
« Reply #2 on: October 19, 2012, 01:16:27 am »
There are also Dec2Num and Num2Dec, I can't remember on which unit they are declared.

 

TinyPortal © 2005-2018