CONVERT BASE 36 TO DECIMAL

Any Vi to CONVERT BASE 36 TO DECIMAL?

Here's the explanation:
The math behind the value is quite simpe: base^position, where the first position left of the decimal sign is 1.
Ton
Message Edited by TonP on 11-13-2008 08:21 AM
Message Edited by TonP on 11-13-2008 08:21 AM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!
Attachments:
Base 36_BD.png ‏8 KB

Similar Messages

  • Converting character to decimal format

    hi
    i am working on a development where the selection screen has date and time as select options.
    and based on the input i have to concatenate date and time into the format- DD.MM.YYY HH.MM.SS
    there is a value in the table that has a field containing the above value and i have to fetch the data based on this input.
    Now the problem is the field in the table is of format DECIMAL of 16 length.
    i want to know how can i pass this value to the select statement.
    thanks in advance

    Hi ,
    Please check the blog on the below link.
    [Re: Converting char to decimal value format as defined in SU3(User profile);
    This will solve your query.
    Regards
    Abhii......

  • How to convert string to decimal in data association function?

    In a BPM Script component, how in the Data Association can I use an expression to convert an argument from String to Decimal?  I have a Process argument named percentage which is a string.  I need to set the value of a data object called signed to either "Y" or "N" based on the percentage being greater than 0.4.  Something like this:
    (percentage > 0.4) ? "Y" : "N"
    The problem here is that percentage is a string, so must be converted to a decimal value before the compare will work.  I cannot find a function that allows that.  I need something like parseDecimal(percentage), but the Expression Builder does not offer that for a string using a Simple Expression.
    If it cannot be converted, is there another way to do this?

    Guessing you figured this out on your own, but if you wanted to use a Script activity one way to do what you want is when you're creating your data associations drag the "Expression" icon in the middle and double click the icon in the middle you just added:
    Get out of the Simple expression mode and into the XPath expression mode by clicking the dropdown in the upper left corner -> click "XPath Exp".
    In the Functions dropdown on the right, click "Conversion Functions" -> click "number" and then insert it into the expression.
    In the Variables list, select your string variable and insert it into the number function so that it looks something like this:  number(bpmn:getDataObject('myStringVariable'))
    Click OK
    Click your expression icon in the middle and drag it over your decimal variable.
    To have it evaluate and return a Boolean expression in your Script activity, add a Boolean process variable and add an XPath expression as described above except have the logic be this:  number(bpmn:getDataObject('myStringVariable')) > .4  (the "greater than" shown above is added to the expression by clicking "Logical Functions" from the functions dropdown).  Click OK and drag your expression icon over your Boolean variable.
    Dan

  • Convert Mainframe Packed Decimal to Oralce Number Format

    Dear all,
    I am having a file in which amount fields are given in a Packed Decimal format. Can anyone suggest me how I can read this data element from the file and convert it into Oracle Number datatype.
    File is a fixed length. All the amount fields are given in Packed Decimal Format and rest of the fields are given in text format.
    Thanks and regards
    Nagasayan Puppala

    Hi,
    Firstly thanks for your reply.
    Actually I am not using SQL Loader to load data from
    a flat file to Oracle table. I am writing a custom
    program that reads the file and populates the oracle
    table. I'll put aside the question of 'why' you'd want to do that. SQL*Loader's singular purpose in life is to load flat files of data into Oracle DB. Sometimes there is a reason for reinventing the wheel.
    How does your program communicate with the Oracle DB? If utilizing ESQL and Pro*Cobol (or Pro*<whatever> ) you will have read the data into a variable of some type in you host language. The variable of the host variable to hold the value (if you did a 'select from' that table) would be the correct target type for an insert statement. Whatever host language type conversion is available bewteen those two types ( if they are different at all ) is all that is needed. The precompilers have converters between certain native host and internal Oracle types built-in. It is how you get any data between the two systems. This is only a problem if the host language has no converter between the numeric types (if differnet.). When you read from the flat file are you reading it into a native packed decimal in the host language?
    ODBC/JDBC similar strategy..... cast conversion between the native type that Oracle wants and the one into which your custom program reads it into.
    So I want to know whether there are any Oracle
    utility programs that will convert the packed decimal
    to a oracle number format or not.There are Oracle routines that convert into the native Oracle DB formats. There are implicitly available through the normally utilized interfaces to OCI ( ESQL and ODBC/JDBC ) . There are none decoupled from those interfaces though (that I know of).
    There are no standalone programs that mutate a flat file into another flat file that then could be loaded. That's is typically slower and utilzes more space than most customers want than just directly inputing the data into Oracle DB.
    Message was edited by:
    lytaylor

  • Formula to convert Hex to Decimal

    Hello All,
    I have "upgraded" from AppleWorks to iWork Numbers. Yes I've read all about how somethings didn't get ported over, etc. What I need is a formula to convert base 16 to base 10. Any ideas how to do this? I see that numbers has a formula editor so is it possible to make up a conversion formula? Someone done this who would like to share?
    Thanks,
    Dan

    Dan,
    Here's a brute-force solution. There may be more elegant ones out there.
    DEC formula is: =IF(ISERROR(LOOKUP(MID(A2, 1, 1), LOOKUP TBL :: A$1:A$16, LOOKUP TBL :: B$1:B$16) * 16^3+LOOKUP(MID(A2, 2, 1), LOOKUP TBL :: A$1:A$16, LOOKUP TBL :: B$1:B$16) * 16^2+LOOKUP(MID(A2, 3, 1), LOOKUP TBL :: A$1:A$16, LOOKUP TBL :: B$1:B$16) * 16+LOOKUP(MID(A2, 4, 1), LOOKUP TBL :: A$1:A$16, LOOKUP TBL :: B$1:B$16)),"", LOOKUP(MID(A2, 1, 1), LOOKUP TBL :: A$1:A$16, LOOKUP TBL :: B$1:B$16) * 16^3+LOOKUP(MID(A2, 2, 1), LOOKUP TBL :: A$1:A$16, LOOKUP TBL :: B$1:B$16) * 16^2+LOOKUP(MID(A2, 3, 1), LOOKUP TBL :: A$1:A$16, LOOKUP TBL :: B$1:B$16) * 16+LOOKUP(MID(A2, 4, 1), LOOKUP TBL :: A$1:A$16, LOOKUP TBL :: B$1:B$16))
    Be sure to Format Col A of both tables to Text.
    Regards,
    Jerry

  • Convert hex to Decimal and keep leading zeros..

    Hi,
    I hope you can help?
    How to convert hex to Decimal and keep leading zeros
    I read 002C, hex, and I want to convert it to 0044 decimal.
    sscanf (MyNum, "%4x", &DecNum); will only give me 44.
    It have been working up till I started to get leading zeros.
    We will always have a 4 digit hex input in a range
    We must have the leading 00 in this case.
    How is this best done?
    Thanks for the help
    Simon
    Solved!
    Go to Solution.

    Hi,
    I don't really understand your problem. Is this stuff what you need ?
    int main (int argc, char *argv[])
    const char MyNum[] = "002C";
    int DecNum;
    sscanf (MyNum, "%4x", &DecNum);
    printf ("%04d", DecNum);
    getchar ();
    return 0;
    "0044" appears on standard output when printf function executes...

  • Converting Binary to Decimal

    I would like to convert 12 and 32 digit strings into decimal. Is there
    a function in labview that does this? Does anyone have a vi (or sub-vi)?
    I'm using version 5.1
    Thanks!
    -DG
    [email protected]
    Sent via Deja.com
    http://www.deja.com/

    Hi Vinny,
    Thanks for the posting Vinny (and Stu). I did figure it out. The
    problem I initially had was that I had a 2-D array going into a for
    loop. I can break the array into 1-D arrays and then change this into
    an array into a string. No problems.
    Thanks!
    -DG
    In article <[email protected]>,
    vjrecca wrote:
    > hmmm, now I don't understand the question, because scan from string
    with a
    > %b format surely does take a string like "101101101110" and convert
    it to
    > decimal number 2926. Could you give a specific example of the string
    and
    > the expected result
    > - Vinny Recca.
    >
    > [email protected] wrote:
    >
    > > I've tried that, but to no success (I first convert the array into a
    > > sprea
    d sheet string, and then use the scan from string function.
    > >
    > > I did write a for while loop to do the conversion (basically using a
    > > shift register and putting the converted bits into an array that's
    > > built be the shift register, then adding them all up at the end).
    > >
    > > The numbers look off. Does Labiew intrinsically change the bits
    like
    > > from 0's to 1's when it's handling them?
    > >
    > > Thanks.
    > >
    > > -DG
    > >
    > > In article <_g3g6.76071$[email protected]>,
    > > "Stu McFarlane" wrote:
    > > > use the %b format string in the scan from string function (string
    > > functions)
    > > >
    > > > wrote in message news:95qec3
    > > $ekn$[email protected]..
    > > > > I would like to convert 12 and 32 digit strings into decimal. Is
    > > there
    > > > > a function in labview that does this? Does anyone have a vi (or
    sub-
    > > vi)?
    > > > >
    > > > > I'm using version 5.1
    > > > >
    > > > > Thanks!
    > > > >
    > > > > -DG
    > > > >
    > > > >
    [email protected]
    > > > >
    > > > >
    > > > > Sent via Deja.com
    > > > > http://www.deja.com/
    > > >
    > > >
    > >
    > > Sent via Deja.com
    > > http://www.deja.com/
    >
    >
    Sent via Deja.com
    http://www.deja.com/

  • Long / double value convertion to Packed Decimal

    Hi,
    Could anybody tell me how to convert a long / double value to Packed Decimal (AS400) ?
    Thanks,
    Probir

    Now I'm writing this value in a flat file by
    FileOutputStream and sending to mainframe through FTP.
    But the mainframe people said it's not converted into
    packed decimal. Is it the right way to convert ??When you say "mainframe" I assume you are referring to a machine that uses EBCDIC. Java, even on the iSeries, uses Unicode and not EBCDIC, so when you FTP anything to the mainframe it will go through an ASCII-to-EBCDIC conversion. You want this to happen for text but you don't want it to happen for packed decimals; your carefully-constructed x'12' x'3f' bytes will be dutifully converted into EBCDIC garbage.
    FTP of an iSeries file (in the QSYS.LIB file system) to a mainframe is trivial because both client and server use EBCDIC, so there are no conversion issues. So if you could do it that way, you definitely should. Otherwise you are going to have to take your packed decimal data and replace it by the bytes that would be translated into it if it were in EBCDIC. The translation table QEBCDIC in library QSYS shows you how it does that, so use that table. You can look it with the command WRKTBL QSYS/QEBCDIC. You'll notice for example that x'09' in ASCII gets converted to x'05' in EBCDIC. So if you want to get x'05' into part of a packed decimal field on the mainframe, you have to send it x'09'. And so on. Like I said, I would recommend doing something other than this. Ask the mainframe people to not make you used packed decimal, for example.
    PC&#178;

  • Checking and Converting binary, octal, decimal, and hex

    Hi,
    I have a classroom project which will need to validate that data entered in a text is of a certain type with a keyListener, and then convert that value to the other 3 types.
    I know character.isDigit will handle the decimal case, and that I can then use Integer.otString methods to convert to binary, octal, and hex, but what about the other cases?
    Thanks

    OK, this isn't working. If I've already established
    that the string entered into, for example, the
    integer-only textfield is a valid integer, I should be
    able to simply use integer.parseint(s, 2) to convert
    it into binary, right?Not exactly. You should be able to use Integer.parseInt(s, 2) to return the result of converting it from binary representation. You appear to think that this affects whatever "s" refers to, which is not the case. Note also, that method returns an int which is the decimal value in question.
    When you are thinking of int variables, be careful not to think of them as "decimal" or "binary". They are neither. They are just numbers. "Decimal" and "binary" are text representations of numbers, so those concepts can only be applied to strings.
    Integer.parseInt(s, 2);
    txtBin.setText(s);So here you want to assume that the input is a string that represents a number in decimal, and you want to find the string that represents the number in binary. Like this:// convert string in decimal representation to number
    int dec = Integer.parseInt(s);
    // convert int to binary representation as string:
    String binary = Integer.toBinaryString(dec);
    // write that to the text field
    txtBin.setText(binary);You could use a one-liner to do that, but you'll need the "dec" variable to set the other text boxes.
    Rembering why I hate OO...All of what I said there is true in just about all computer languages, OO or otherwise.
    PC&#178;

  • Convert base 64 code to Image/ImageIcon

    Hi,
    suppose we have a base 64 code characters that we need to process and convert to Image file
    i suppose we need first to convert base 64 code to byte array then convert byte array to image. is that right ?
    can someone describe me how to implement this feature ?
    thankin you.

    Well, you've pretty much described what you need to do. Where are you getting stuck? Base 64 decoding is a little tricky to get right, but there are existing classes that do what you need. I think if you look at the Java Mail package there is a Base 64 decoder in there. Or just google "base 64 decoder java".
    Good luck.

  • Need to convert varchar2 into decimal

    Hi,
    I need to convert source sybase varchar2 record in to decimal record in Target DB2 table by using the function in Oracle data integrator.
    In my source table, column is defined as varchar2 (4) and in target table same column has defined as Decimal (2). So, is there any function to convert the varchar2 data to decimal record.
    thanks,
    keshav.

    865709 wrote:
    Hi,
    I need to convert source sybase varchar2 record in to decimal record in Target DB2 table by using the function in Oracle data integrator.You may have more luck in the proper forum
    Data Integrator

  • Convert commas to decimal in oracle

    I have source table as
    create table test
    LoadId Number(10),
    Data varchar2(5)
    LoadID has inceremental values for 1,2,3,.....
    Data has values as given below
    2
    0,5
    1.5
    2,5
    0
    0
    0
    2,5
    1
    1,5
    0,5
    1,5
    1,5
    0,5
    I want to select values from data field but while selecting i want to covert them to number datatype i.e. commas will be converted to decimal points.
    So needed values will be like
    2
    0.5
    1.5
    2.5
    0
    0
    0
    2.5
    1
    1.5
    0.5
    1.5
    1.5
    0.5
    How can i achieve this ?

    select to_number(data,'999D99','nls_numeric_characters = '',.''') from test;?

  • Help converting binary to decimal.

    Hi all.
    I'm taking a course in Java programming and so far its been a great experience. I'm currently stumped on one of my assignments and I am kindly requesting some assistance.
    Basically I have to convert a binary entry into its decimal comparison.
    so for instance an entry of 1101 would output 13.
    I have the calculation formula, but my problem is finding out whether the point i'm looking at is either a 1 or a 0. I can't seem to 'strip it down' to the value.
    My current thought is something like this:
    binary = 1101;
    // problem is here
    thou = (binary % 1000) / 1000;
    hund = (thou % 100) / 100;
    tens = (hund % 10) / 10;
    ones = (tens % 1) / 1;
    // then do formular
    decimal = ones * 1 + tens * 2 + hund * 4 + thou * 8;
    I have searched but all the suggestions say to use a custom function or other obscure method. I don't know that stuff real well and we aren't even that far in the book either. All we've done so far is while, if .. else, condition statements.
    I will include the actual text for the question, in case i'm not clear. This text also includes a 'tip' which isn't helping me. (http://www.geocities.com/kaveman2000/q-4-25.pdf)
    Thanks again for any pointers.

    angeles1016 (and all),
    thanks for your great help and code snippets.
    angeles1016,
    using the code you provided i noticed that the last (single digit) was giving the wrong response in certain cases. (1000, 0111, 0001, ..) i could be off one.
    either way, i decided to fix it up and give you all the update.
    // do class, main function stuff
         if(binary/1000 == 1){
              thousands += (binary/1000);
         temp = binary % 1000;          
         if(temp/100 == 1){
              hundreds += (temp/100);
         temp = temp % 100;          
         if(temp/10 == 1){
              tens += (temp/10);
         temp = temp % 10;
         if(temp/1 == 1){
              ones += (temp/1);
         // calculate binary to decimal     
         decimal = (ones * 1) + (tens * 2) + (hundreds * 4) + (thousands * 8);
         // take result and convert to string for output
         result += "Decimal: " + decimal + "\n";
    // display in gui ?
    // end function and class stuff(note: i suppose the statements similar to "thousands += (binary/1000);" can be simplified as "thousands = 1;")

  • Converting Hex to Decimal

    hi,
    I want to convert my hex value to decimal. How can I do this? help me pls.
    Suku

    actually...the hardware I'm interacting through com port will retrun data every time in different length. I'm reading that data, byte by byte only. So in that second byte I'm getting the length of the data returned by the hardware. Now for executing my loop that length is required.
    while ((ch = (byte)portInStream.read())!=-1)
    indata[i] = ch;
    String hexString = Integer.toHexString(indata);
    hexDec = Integer.parseInt(hexString);
    strData =strData + hexString;
    i++;
    if(i==15) break;
    in the above code I'm reading 15 bytes from the port. But it may vary...to know the length I want to convert the second byte to int.

  • Required code to convert binary to decimal

    i need the programming logic to convert a binary number into its decimal equivalent. the program should also detect a non binary number.

    public class EnterBinary{
       public static void main (String []args){
       int binCheck=0;
       String bins="";
       try {
          bins=args[0];
       catch (Exception e){
          System.out.print("No user input, program will terminate");
          System.exit(0);
       for(int i=0; i<bins.length(); i++)
          if((bins.charAt(i)=='1')||(bins.charAt(i)=='0')) binCheck++;
       if(binCheck==bins.length() ) {
          int j=1;
          binCheck=0;
          for(int i=0; i<bins.length()-1; i++) j *=2;
          for(int i=0; i<bins.length(); i++){
             if(bins.charAt(i)=='1') binCheck += j;
             j /=2;
       System.out.print("The binay number "+bins+" in decimal is "+binCheck);
       else System.out.print("Invalid binary input, program will terminate");
    }

Maybe you are looking for

  • Legend and bars colors on charts not consistent.

    Using Crystal XI, I have a report that selects a top 10 categories in the report.  For each of the 10 categories, I have 4 stacked bar charts showing "dispatched" and "not dispatched".  I also have 1 subreport that charts two trend lines(one for "dis

  • How to add attachment and export data into MS Access

    Let's say that I use PDF file to capture data from users and import the data to MS Access database (via XML). I wonder if there is a way to let user add attachments in Acrobat Reader and when the data is exported, the attachments are kept separately

  • Error in posting run

    dear gurus I am settling the travel expenses in t code PRFI, while creating the posting run i am getting the following error.     Posting Run 3              Non-Postable Trips                  Personnel No. 99087571 raju surya narayana               

  • Any one help me..? working with scrollbar @ widget...

    hi! any one help me? how to create a scrollbar in widget. thanks in advance. -yajiv

  • My imessage and facetime wont activate on my iPhone 5

    i just restored my phone yesterday, then backed it up from icloud and my computer, i was activating my imessage and facetime but it would say waiting for activation for hours, its been over 12 hours now and it still has not activated. I've tried ever