Conversion of Binary Numbers to Decimal Numbers in Scripting

    Hi All,

     

    I hope this script helps you when you require to convert Binary numbers to Decimal numbers.

     

    Table:  
    LOAD Binary, Sum(DecimalValue) AS Decimal  
    GROUP BY Binary;  
    LOAD Binary,
      Alt(Pow(If(Mid(Binary, IterNo(), 1) = 1, 2), Len(Binary)-IterNo()), 0)  AS DecimalValue
    While Iterno() <= Length;  
    LOAD Text(Binary) AS Binary,  
        Len(Binary) AS Length
    Inline [  
    Binary  
    1011 
    10000
    00000
    11111
    000010111101011101111010
    10111
    0000
    00
    0
    ];
    

     

    Hope this helps you.

     

    Regards,

    jagan.