Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Does anybody have a script for converting a hexadecimal number into a decimal number. thanks

Hi,

sorry for my ignorance but is hexadecimal 12,22654587 and you want it to be 12,25 ?

If so, try a calculation instead of a script :

Int((your number field + .12) * 4) / 4

(Position("0123456789ABCDEF";Middle(Hex;1;1);1;1)-1) *16 +

(Position("0123456789ABCDEF";Middle(Hex;2;1);1;1)-1)

for 2-digit hex numbers.

for 3 digit:

(Position("0123456789ABCDEF";Middle(Hex;1;1);1;1)-1) *16*16 +(Position("0123456789ABCDEF";Middle(Hex;1;1);1;1)-1) *16 +

(Position("0123456789ABCDEF";Middle(Hex;2;1);1;1)-1)

and so on

Good Mornung UGO,

still at work?

[substitute the ";" for "," in the US)

I'm still working on my next version of the RussCalcs from Oz file (normally found under the samples section of this forum). So there still are some spare sections in this attachment - but the binary / octal / hex and generic Base (Base34 in the example) calculations are all done.

In the attached file, click on the BASE tab and you can see these calcs.

RussCalcs from Oz v5.fp5.zip

But if all you're after is the Hex to decimal calculation itself, here it is: This works from the Hex Input being in the Base_Hex_IP field (text). Maximum length of the Hex string this will handle is 12 (FFFFFFFFFFFF).

Case(

IsEmpty(Base_Hex_IP),0,

Position("0123456789ABCDEF",Right(Base_Hex_IP,1), 1, 1) -1 +

Case(Length(Base_Hex_IP)>1,(Position("0123456789ABCDEF",Middle(Base_Hex_IP,Length(Base_Hex_IP)-1,1), 1, 1) -1) * 16^1,0) +

Case(Length(Base_Hex_IP)>2,(Position("0123456789ABCDEF",Middle(Base_Hex_IP,Length(Base_Hex_IP)-2,1), 1, 1) -1) * 16^2,0) +

Case(Length(Base_Hex_IP)>3,(Position("0123456789ABCDEF",Middle(Base_Hex_IP,Length(Base_Hex_IP)-3,1), 1, 1) -1) * 16^3,0) +

Case(Length(Base_Hex_IP)>4,(Position("0123456789ABCDEF",Middle(Base_Hex_IP,Length(Base_Hex_IP)-4,1), 1, 1) -1) * 16^4,0) +

Case(Length(Base_Hex_IP)>5,(Position("0123456789ABCDEF",Middle(Base_Hex_IP,Length(Base_Hex_IP)-5,1), 1, 1) -1) * 16^5,0) +

Case(Length(Base_Hex_IP)>6,(Position("0123456789ABCDEF",Middle(Base_Hex_IP,Length(Base_Hex_IP)-6,1), 1, 1) -1) * 16^6,0) +

Case(Length(Base_Hex_IP)>7,(Position("0123456789ABCDEF",Middle(Base_Hex_IP,Length(Base_Hex_IP)-7,1), 1, 1) -1) * 16^7,0) +

Case(Length(Base_Hex_IP)>8,(Position("0123456789ABCDEF",Middle(Base_Hex_IP,Length(Base_Hex_IP)-8,1), 1, 1) -1) * 16^8,0) +

Case(Length(Base_Hex_IP)>9,(Position("0123456789ABCDEF",Middle(Base_Hex_IP,Length(Base_Hex_IP)-9,1), 1, 1) -1) * 16^9,0) +

Case(Length(Base_Hex_IP)>10,(Position("0123456789ABCDEF",Middle(Base_Hex_IP,Length(Base_Hex_IP)-10,1), 1, 1) -1) * 16^10,0) +

Case(Length(Base_Hex_IP)>11,(Position("0123456789ABCDEF",Middle(Base_Hex_IP,Length(Base_Hex_IP)-11,1), 1, 1) -1) * 16^11,0)

)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.