alteryx Community

# Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

## Signed short hexadecimal

7 - Meteor

Hi,

Need help to convert Signed short hexadecimal to decimal

For example FD80 should be converted to decimal value -640.  Can you please provide Alteryx solution for this in the formula tool?

2 REPLIES 2
Alteryx

Hi @myousuff81 ,

This should work as long as there is 1 hexadecimal per-row in the column. Can handle any size Hexidecimal!

``````if HexToNumber([HexField]) > HexToNumber(PadRight('8', length([HexField]),'0')) then

-2*HexToNumber(PadRight('8', length([HexField]),'0')) + HexToNumber([HexField]) else

HexToNumber([HexField]) endif

//PadRight('8', length([HexField]),'0') = negative crossover point

// -(negative crossover point as integer) - (subtracting negative crossover from original Hex) + (original hex)
// = -2(neg. crossover point as int) + (original hex as int)
// Joe L``````

7 - Meteor

Thanks Joel. It works perfectly.

Labels