Converting a character to a number

Hello.
How can I convert a char into a number?
A => 1
B => 2
C => 3 and so on...
I know I can do this with using switch or if statement, but Im wondering if there is a better way for this.
Thanks.

Stupid is as Norweed does.well seeing as you've NEVER even attempted to help
anyone on this site and every single one of your
posts is just childish blathering, I don't really
think you ahve room to talk.Awww. Is the poor litlte baby getting upset? Maybe
you could just kill yourself?Nope not getting upset at all. Seriously, are you 5 years old...maybe 15?

Similar Messages

  • Approach to converting database character set from Western European to Unicode

    Hi All,
    EBS:12.2.4 upgraded
    O/S: Red Hat Linux
    I am looking for the below information. If anyone could help provide would be great!
    INFORMATION NEEDED: Approach to converting database character set from Western European to Unicode for source systems with large data exceptions
    DETAIL: We are looking to convert Oracle EBS database character set from Western European to Unicode to support Kanji characters. Our scan results show
    both “lossy (110K approx.)” and “truncation (26K approx.)” exceptions in the database which needs to be fixed before the database is converted to Unicode.
    Oracle Support has suggested to fix all open and closed transactions in the source Production instance using forms and scripts.
    We’re looking for information/creative approaches  who have performed similar exercises without having to manipulate data in the source instance.
    Any help in this regard would be greatly appreciated!
    Thanks for yourn time!
    Regards,

    There are two aspects here:
    1. Why do you have such large number of lossy characters? Is this data coming from some very old eBS release, i.e. from before the times of the Java applet interface to Oracle Forms?  Have you analyzed the nature of this lossy data?
    2. There is no easy way around truncation issues as you cannot modify eBS metadata (make columns wider). You must shorten or remove the data manually through the documented eBS interfaces. eBS does not support direct manipulation of data in the database due to complex consistency rules enforced by the application itself (e.g. forms).
    Thanks,
    Sergiusz

  • How to convert any datatype to a number

    Hi --
    I have a query I'm writing, and for error-trapping purposes I want to convert whatever information I received in a bind variable into a number.
    For instance, in my query:
    SELECT TO_NUMBER('c') FROM dual
    I get an error because 'c' is not a number. I'm usually expecting a number, but if for some reason I receive a character, I want to convert that character to a zero, and if I do receive a number I want it to retain its value. I hope this is clear!!!
    Any suggestions are greatly appreciated.
    Thanks,
    Christine

    Unfortunately, I need to do this directly in the SQL statement if at all possible.If you don't want to use a function, try :
      1  select case when ascii('&1') between 48 and 57 then to_number('&1')
      2              else 0 end
      3* from dual
    SQL> /
    Enter value for 1: a
    Enter value for 1: a
    old   1: select case when ascii('&1') between 48 and 57 then to_number('&1')
    new   1: select case when ascii('a') between 48 and 57 then to_number('a')
    CASEWHENASCII('A')BETWEEN48AND57THENTO_NUMBER('A')ELSE0END
                                                             0
    SQL> /
    Enter value for 1: 5
    Enter value for 1: 5
    old   1: select case when ascii('&1') between 48 and 57 then to_number('&1')
    new   1: select case when ascii('5') between 48 and 57 then to_number('5')
    CASEWHENASCII('5')BETWEEN48AND57THENTO_NUMBER('5')ELSE0END
                                                             5
    SQL> Nicolas.
    ascii(9) => 57
    Correction for ascii(0) => 48 and not 49...
    Message was edited by:
    N. Gasparotto

  • How to convert an int variable into Number

    Hi all,
    I am using Jdeveloper 11.1.1.2
    When I insert a row in a entity object I want to create another row in another entity object, but when I am setting the attribute for the new row I have a problem.
    Here is the code:
    int a = EO1Impl.paramA;
    NameEO2Impl.setAttribute("Attribute1", a);
    The error is that variable a is an int, while Attribute1 is a Number.
    How can convert an int to a Number.
    Thank you.

    Andrea9,
    If a, as you say is an int, and assuming you mean an oracle.jbo.domain.Number,
    NameEO2Impl.setAttribute("Attribute1", new oracle.jbo.domain.Number(a));works just fine.
    John

  • Why summaries are converted to character when exported to excel??

    Hi,
    When i export my discoverer workbooks to excel, all of my summaries are converted to character type and excel gives error messages for each cell and asks to convert them back to numbers. Its not possible to do so because Discoverer plus is a client tool and no client would prefer rework. They'll simply say why to use Discoverer then?
    Any suggestions appreciated.
    Thanks.

    Using Acrobat DC and the acrobat arrow tool. By right clicking on an image a submenu pops up. One of the items in that list is "Edit Image".  Ordinarily or historically this would then open the image in Photoshop as a temp file. Edits could be made and saved and the image would be auto updated back into the PDF.  In DC when selecting edit image, the document goes into a edit mode and the entire file gets converted into RGB color.  From here one could again right click on the same image and get the option to edit using another program, (like photoshop).  When returning back to document mode, the RGB conversion remains.
    I determine the files are converted to RGB by using the inspector tool in Acrobat as well as looking at the colorspace in Photoshop
    I determined the files were CMYK by building them that way and again verifying using Pitstop inspector.
    Following screen grabs show image before / and after selecting "Edit Image"

  • It's possible to convert 'WE8MSWIN1252' character to chinese character set?

    Hi All,
    Is anyone know how to convert "WE8MSWIN1252" character to chinese character set in order to display chinese word in oracle apex?
    My problem is i can't display chinese character set in oracle apex. The chinese field is showed like °×ѪÇò¼ÆÊý. I'm using WE8MSWIN1252 database character set.
    I'm wondering it's possible to show character word?
    I'm appreciating if anyone have a good solution to share with me.
    Thanks a lot in advance!
    Edited by: Apex Junior on Jul 16, 2010 2:18 PM

    WE8 is a Western European character set. If you wish to store and access a globalized multibyte character set you must have a database that supports it: You don't have one at the moment.
    Given this is Apex I'd suggest you read the docs and reinstall.
    Alternatively you could try CSSCAN and CSALTER and perhaps you can make the change but be very careful and have a good backup before you try.
    http://www.morganslibrary.org/reference/character_sets.html

  • How to convert amount data element to number data element

    Dear Gurus,
    I have a requirement to get the data by calling BRF+ and then pass them to BAPI 'BAPI_ASSET_ACQUISITION_POST', in the BRF+ export structure, there is a field 'AMOUNT', I bind it to DDIC element 'BF_ANBTR', the type is Number.
    In BRF+, I call another global function to calculate the value, I define a local variant LV_VALUE to get export value from this function, this local variant's type is Amount, now I need to move this local variant value to the export field 'AMOUNT'.
    But BRF+ doesn't allow to convert amount data element to number data element directly, and I find there is no formula function available. Only there is a function 'TO_AMOUNT' to convert number data element to amount data element.
    Please help to get a solution for above solution.
    Thanks.

    Hi,
    within the formula expression within the category "Mathematical functions" you will find the function "TONUMBER". This converts a data element of type currency to a number. According to the help of this function:
    "The following conversion rules apply:
    <Amount>: The number part is returned. The currency unit is omitted."
    This is what you are looking for.
    For the other way round you already mentioned the correct function "TO_AMOUNT"
    BR
    Christian

  • Problem : "You cannot convert the character set"..Any suggestions?

    Hi All,
    I have this character inside my internal table, KOÇTA&#350; YAPI MARK.T&#304;C A.&#350;. and it created a short dump on the program and it says "You cannot convert the character set". But this customer is already maintained inside the table KNA1..
    The code is like this one:
    REPLACE ALL OCCURRENCES OF '€' IN linebuffer WITH 'EUR'.
    TRANSFER linebuffer TO filename. "LENGTH bytes_to_transfer.
    the LINEBUFFER here is an internal table.
    I think conversion is the key here. Do anyone knows how to convert this thing? Or is it the Unicode system?  Could someone please help me to my problem?
    Thanks so much guys!
    Regards,
    Mackoy

    Hi,
    What i feel here is you are trying to pass  totla internal table at once.Internal table may have more than one record.Filename may string which can contain one row.
    So instead of that put the internal table into LOOP.
    DATA : v_string(200).
    LOOP AT  LINEBUFFER.
    Here your internal table may have non char data type.That is the
    main problem.
      Note : while concatenating all non char fields of LINEBUFFER
               should move to first to temporary char field and conatenate it
    CONCATENATE  LINEBUFFER-field1 LINEBUFFER-field2
      INTO  v_string.
    ENDLOOP.

  • In fact it's about mac:excel, how convert in a cell a number written in text format into a value?

    in fact it's about mac:excel8 or 11 in OSX10.7.4,
    how convert in a cell a number written in text format into its value?
    cheers francois

    Hi francois,
    If I copyone of them and do a past special/value, it does not work.
    Try just Paste instead of Paste Special > Value
    I know your question is about Excel, but this works in Numbers:
    Copy 1 234 567 (with spaces) and Paste (not Paste Special) into a Cell in a Numbers Table. The result is 1234567 and it behaves as a number. A formula will consider it to be a number:
    You asked Wayne: what do you mean by "to reference a cell" ??
    The reference is from Cell A2 to Cell A1 through a formula, such as: =A1+1
    Regards,
    Ian.

  • Converting a character to ASCII

    Hi ,
    I have a string and I should be converting it into to ASCII character.
    Is there a method in java where we can convert a character(something like "a") to a ASCII character("65").
    Thanks,
    Anna

    Hello Abikkina,
    This is how you can do...
    String s ="Example"
    int [] ascii = new int[s.length()];
    for(int i =0; i<s.length(); i++)
    ascii[i] = (int)s.charAt(i);
    for(int i = 0; i<ascii.length; i++)
    System.out.println("Ascii output"+ascii);
    Just cast the character into int then you will get the ASCII value.

  • How do I convert '2.0E8' to regular number?

    I would like to convert from and scentific number
    2.0E8 ---> 200000000.0
    Is there any classes that I can use to detect scientific number and then convert it to
    a real number?
    Thank you.

    I think java.text.DecimalFormat is what you are looking for.
    http://java.sun.com/j2se/1.3/docs/api/java/text/DecimalFormat.html

  • Convert Character to ASCII Number

    Hello.
    I would greatly apprectiate if someone could tell me how to convert a Number or Character to its ASCII decimal representation. For example if I have the number 9 I would like to save its ASCII decimal number 39 instead.
    Thank YOU!!

    By the way, getNumericValue doesn't return the unicode value of the character but the numeric value - for instance it returns the int 9 for the character '9' and the int 15 for the character 'F' (since 15 is F in hex).

  • How can i convert an ascii character to a number?

    where can I find the function?

    A string will be converted to an array of U8.
    Unless you convert a single character.
    RayR
    Message Edited by JoeLabView on 06-27-2008 05:39 PM
    Attachments:
    Str2Num.vi ‏7 KB
    String2Number.PNG ‏7 KB

  • How to convert the character value to currency/numeric

    Hi,
    See the sample code here
    data: v_qtr_field(7).
    data: w_low_limit like glt0-kslvt,
          w_amount like glt0-hslvt.
    w_low_limit = 02.
    w_max_period = 3.
    concatenate 'HSL' w_low_limit into v_qtr_field.
    *comment
    *I am looking for a field formation thru above code like in GLT0 table like HSL02,HSL03 *etc based on the value user entered in the selection *screen
    DO w_max_period TIMES
      VARYING w_amount FROM v_qtr_field NEXT v_qtr_field + 1.
       t_trans_values-dmbe2 = t_trans_values-dmbe2 + w_amount.
      ENDDO.
    I am facing problem in the Do loop as it wont allows multiple data types. can you suggest me how to convert the v_qtr_field whose data type is character to currency?

    Hi,
    Please check this code .
    PERFORM write_currency
                  USING buf_anla-urwrt t_dates-waers t_txw_anla-urwrt.
    *       FORM WRITE_CURRENCY                                           *
    *       convert currency amount to string                             *
    *       - use decimal point                                           *
    *       - remove separator characters                                 *
    *  -->  P_AMOUNT                                                      *
    *  -->  P_CURRENCY_UNIT                                               *
    *  -->  P_STRING                                                      *
    FORM WRITE_CURRENCY
         USING P_AMOUNT        TYPE P
               P_CURRENCY_UNIT LIKE TCURC-WAERS
               P_STRING        TYPE C.
      DATA: DEC2POINT(2) TYPE C VALUE ',.'.
    * convert separator to decimal point
      WRITE P_AMOUNT TO P_STRING CURRENCY P_CURRENCY_UNIT
            NO-GROUPING
            NO-SIGN
            LEFT-JUSTIFIED.
      TRANSLATE P_STRING USING DEC2POINT.
    * put minus sign before number
      IF p_amount < 0.
        SHIFT P_STRING RIGHT.
        P_STRING(1) = '-'.
      ENDIF.
    ENDFORM.
    <i>Hope This Info Helps YOU.</i>
    Regards,
    Lakshmi

  • Convert hexadecimal output to decimal (number)

    I am reading hexadecimal format from the output of the VISA read block and I want to convert it to the decimal preferably exponential format.
    Example of what I read is 76 00 02 (in dec: 7.600 E+2).
    I know there is "type cast" block that converts nicelly but I am not sure what to specify for a type input.
    Can you show me how to apply this type cast block for in my VI so that it converts hex string (76 00 02) into exponential string/number (7.600 E+2)?
    I attached my VI so it is more clear.
    Thanks everybody,
    Pedja
    Attachments:
    MultiGauge.vi ‏64 KB

    Coop wrote:
    > I am reading hexadecimal format from the output of the VISA read block
    > and I want to convert it to the decimal preferably exponential format.
    > Example of what I read is 76 00 02 (in dec: 7.600 E+2).
    > I know there is "type cast" block that converts nicelly but I am not
    > sure what to specify for a type input.
    > Can you show me how to apply this type cast block for in my VI so that
    > it converts hex string (76 00 02) into exponential string/number
    > (7.600 E+2)?
    Looking at your code I see that you have not a hexadecimal string coming
    back but instead a binary string. The fact that you display the string
    as hexadecimal in the string indicator is just showing you the ASCII
    codes of the string characters as hexadecimal numbers.
    The funct
    ion From Hexadecimal String expects a clear text string with
    hexadecimal characters but that is something entirely different from a
    binary string you choose to display as hexadecimal numbers.
    An example: the binary string 7600 02 you receive from the device is in
    fact the character 'v', a null character and a 02 character (or in ASCII
    terms a start of text character).
    So assuming your example is right (which I have to admit seems very
    strange and therefore suspicious to me) you would have to do something
    more like included example. But as I said I have little understanding
    why the hexadecimal interpretation of the binary values should
    correspond to the decimal value you want to have!
    Also as you can see there is not really clear where the 00 character
    belongs to. The two methods where it is either part of the multiplier or
    the exponent both produce the same result for this particular example.
    Which one is right if any, should be tested.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions
    Attachments:
    Binary_(Hex)_to_Decimal_Numeric.vi ‏51 KB

Maybe you are looking for