Visokio website     Downloads     Video tutorials     KnowledgeBase  
Scripting: Converting Hexadecimal string to Decimal number? - Visokio Forums
Scripting: Converting Hexadecimal string to Decimal number?
  •     sherriff May 16, 2015 3:03PM
    I need to convert a Hexadecimal string into Decimal

    Any suggestions as to how to do this?
  • 2 Comments
  •     paola May 18, 2015 6:12AM
    Hex, or hexadecimal, is a number system of base 16, using the first 10 digits (0,1,2....9) and the first 6 letters of the English alphabet.
    Hexadecimal=Decimal
    0 0
    1 1
    2 2
    3 3
    4 4
    5 5
    6 6
    7 7
    8 8
    9 9
    A 10
    B 11
    C 12
    D 13
    E 14
    F 15

    You can perform Hex -> decimal conversion by using Omniscope operations - Expand values, Search/Replace and formulas.

    IF(
    [Class]=1,[Value]*POWER(16, 0),
    [Class]=2,[Value]*POWER(16, 1)+[Value (1)]*POWER(16, 0),
    [Class]=3,[Value]*POWER(16, 2)+[Value (1)]*POWER(16, 1)+[Value (2)]*POWER(16, 0),
    [Class]=4,[Value]*POWER(16, 3)+[Value (1)]*POWER(16, 2)+[Value (2)]*POWER(16, 1)+[Value (3)]*POWER(16,0)
    ,
    null)


    Please see attached file that you can use as a template, replacing the original data source with your own.

    image
  •     mustafa May 19, 2015 9:32AM
    You can also use a formula field using the script function to achieve this:

    SCRIPT('parseInt(valueToConvert, 16)', "valueToConvert", REFVAL("Hex"), 10000)


    Where "Hex" is the field which contains hex value (Example attached).

Welcome!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership