Query to remove decimal point

Hi all,
I have a table A, in which there is a column currency with integer values having decimal point, i have to just remove the decimal and keep the number as it is.
Ex:- A number 23.45 should be 2345
A number 17.9 should be 179
I have to do this for all the currency values of the table A.
Can someone kindly help me with a query.
regards,

Hi,
user10243788 wrote:
Thank you all for replying,
The problem is that there are different rows in table A, i.e many values, so i think we would have to pass this value as variable in runtime.Sorry, I don't understand.
What value do you think you have to pass as a variable? The decimal point character ('.' in America, ',' in Germany)? The number of decimal places? Some value, such as 175?
select to_number(replace (1.23, '.')) from dual;
or
SELECT REPLACE (crncy, '.') AS crncy_w_o_dot
FROM table_x;
how can i use the above query like a loopAny query is like a loop; it finds each row, and does the same sort of thing to each one.
i.e if i have many values like below in the column currency, how can i change them all.Are you saying you have different columns that need to be transformed?
If so, the answer depends on what your data is like, what results you want, and what version of Oracle you're using..
If what you want to do is simple, and the number of columns isn't to big, the best thing is to repeat the formula for every column.
Other options are likely to be slower.
You could write a user-defined fucniton to do the transformation.
You could unpivot the table, so that all the columns to be transformed become one column. You could then pivot the results back to the original number of columns, if necessary.
17.5
23.456
89.9343
43.98121thanks again for your help,Is this your sample data? It looks like just one column. Post some sample data as CREATE TABLE and INSERT statements.
What are the results you want from that data? If you need to pass some parameter to the query, give a couple of examples of different parameters and the different results they produce given the same sample data.
Whenever you have a question, say what version of Oracle you're using.
Edited by: Frank Kulash on Jul 13, 2010 11:05 AM

Similar Messages

  • Remove decimal points

    Hi,
    how to remove decimal points from all the columns in table in obiee
    thanks

    hi
    add one decimal point
    is this the same? or any?
    Cheers

  • JSP removing decimal points

    Hello all.
    I am developing a site and Im new to JSP. now one of the pages I am developing needs to pull data out of a MySQL table.
    I can pull the data and it is working great! BUT the particular data I am pulling is pricing information.
    The data is in the following form:
    1.4800
    thats a price so its one dollar and fourty eight cents.
    the extra two decimal points are needed by the backend software so I cant remove them from the MySQL table (plus there is like 66,000 entries in the table).
    I need to find a way to remove these with JSP some how as they are irrelevant to what we need to display. the numbers are already rounded off so that all entries end with two 0's is there an easy way to remove these two zero's?
    Just so you know my code goes something like this.
    <form>     
    <% out.println("<select name=\"select\">");
    out.println("<option selected>Please select a Country</option>");
    int iBusNo = 0;
    int i = 0;
    while(bMoreData)
    out.println("<option>" +BusDirRecordset.getString("LongName")+ " - $" +BusDirRecordset.getString("Rate")+ "</option>");
    bMoreData = BusDirRecordset.next();
    i++;
    out.println("</select>");
    %>
    </form>If you have any suggestions I'd greatly appreciate the help!

    Go to http://java.sun.com/j2se/1.4.1/docs/api
    Look up the documentation for the class "NumberFormat".
    Cut and paste (with a slight mod) from the online document:
    NumberFormat nf = NumberFormat.getInstance();
    nf.setMinimumFractionDigits(2); // cut off trailing zeroes
    nf.setMaximumFractionDigits(2); // change "1.5" to "1.50"
    for (int i = 0; i < a.length; ++i) {
        output.println(nf.format(myNumber[ i ]) + "; ");
    A neat side-effect is that it's supposed to know your local "locale" information, so if you're in Spain using commas instead of periods as the fraction separator, that's what it'll do.

  • Remove decimal points from variable.

    Hi,
    I have a little issue.
    I have one variable v = 25.000
    and i want to remove (.000) from this variable so my result will be only 25 and i want this.
    So, is ther any function to remove this?
    I want to do it in one shot.
    No 2-3 statements.
    Points rewarded soon
    Regards
    RH

    Hi Ronny,
    You move this variable data to an integer variable.
    Data: v_tempint   type i.
    move your_variable to v_tempint.
    v_tempint will have the required result.
    Reward points if this helps,
    Kiran

  • How to remove the decimal points at the end of the value????

    hi,
    we are using crystal reports 9.0. we have some reports which contains group by field.  we have one field like address. if we select group by as address "The data is displayed grouped by the Address. But the address is shown in decimal points". for example if we have 55 as address field value, it shows 55.00. 
    the formula has written like as follows
    if lowercase({?GroupBy}) = 'Address' then totext({rsp_GetDevMicro.Address})
    now, i want to remove zeros which comes along with address field values.
    can anyone help me in this?

    Not sure about Crystal 9 but on 11 I would convert it to a number to remove the leading zeroes then back to text again which allows you to remove the decimal point and any thousand seperators, ie:
    CStr(ToNumber(),0,"")

  • HOW to remove the decimal points for particaular field

    hi friends,
    Iam printing the quntity in decimal mode like 2.000.
      but i want to print this as only 2.
      How can i remove the the decimal in smart form..
    Iam  printing  amount as 1234.00000.
    But i have to print two zeros after decimal point..how can i remove zeros .
    appricioate for u r answers..
    regards,
    sampath kumar

    You may use the option
    field(.0) for printing the quantity
    field(.2) for printing the amount..
    Go through SAP help given below..
    <b>Number of Decimal Places
    A program symbol of one of the data types DEC, QUAN, and FLTP can contain decimal place data. Use the option below to override the Dictionary definition for the number of decimal places for the formatting of this symbol value.
    Syntax
    &symbol(.N)&
    The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.
    &EKPO-MENGE& -> 1,234.560
    &EKPO-MENGE(.1) -> 1,234.6
    &EKPO-MENGE&(.4) -> 1,234.5600
    &EKPO-MENGE&(.0) -> 1,235</b>

  • Removing zeros after the decimal point       Reply with quote

    I want to remove the zeros after the decimal point, that this be done?
    Например, Example,
    120.000 => 120 120.000 => 120
    120.300 => 120.3 120,300 => 120.3

    hiiiiiiii sweetsoni,
    try this may it helpful for you
    SHIFT string RIGHT DELETING TRAILING '0'.
    SHIFT string RIGHT DELETING TRAILING '.'.
    for example
    DATA: v1 (6) TYPE c VALUE '100 .000 ',
    v2(6)  TYPE c VALUE '100.200'.
    SHIFT v1 RIGHT DELETING TRAILING '0'.
    SHIFT v1 RIGHT DELETING TRAILING '.'.
    SHIFT v2 RIGHT DELETING TRAILING '0'.
    SHIFT v2 RIGHT DELETING TRAILING '.'.
    ultimately
    v1 = '100',
    v2 = '100.2'.
    Moderator message: question and answer copied from external source, points deducted, do not repeat!
    Edited by: Thomas Zloch on May 19, 2010 2:14 PM

  • How to remove zero after decimal point.

    hi friends
    how to remove the zero after decimal points.
    example :
    123.450 -- if print only 123.45
    45.600  - 45.6
    any body help me.
    thanks
    pauldhama

    go through this example
    it may help u
    DATA: T(14) VALUE ' abcdefghij',
    STRING LIKE T,
    STR(6) VALUE 'ghijkl'.
    STRING = T.
    WRITE STRING.
    SHIFT STRING LEFT DELETING LEADING SPACE (or use 0 to detete 0).
    WRITE / STRING.
    STRING = T.
    SHIFT STRING RIGHT DELETING TRAILING STR or 0.
    WRITE / STRING.
    Output:
        abcdefghij
    abcdefghij
            abcdef

  • Query about decimal point field in mapping

    hi,
    In interface one field is supposed , Both dollars and cents will be formatted with an implied decimal point before the last  two digits in the data. 
    for exm : input is -620.27. then output should be -000062027. Maximum length of the field is 10.
    if input is 44.44.then output should be 0000004444.
    In this way.
    Name of the field is Pay_Amount.
    how do i get this mapping?
    Regards,
    Sanghamitra

    Use the replace string function to replace decimal point with null. Then pass the value to a udf.
    Write a udf (value cached) and pass the input a= value from Pay_Amount and b - required length of field (10)
    public String AddLeading(String a,String b,Container container){
    String temp = new String(String.valueOf(Integer.parseInt(a)));
    int temp1 = Integer.parseInt(b);
    for(int i = 0; (temp1 - a.length()) > i ; i++)
    temp = "0" + temp;
    return(temp);

  • Decimal Points in Report Output

    Dear Experts,
    We have a keyfigure 0GR_Qty in the cube 0pur_c01.
    For a Purchase order the 0GR_Qty in the cube 0pur_c01 is 9.12 MT.
    We created a report on this cube and executed the report for this PO, but in the output the 0GR_Qty is showing as 9.00 MT.
    It is not showing the decimals. I tried with removing the decimals and also increasing the decimal points to 4 or 5 etc. But also it is
    not displaying the decimal points.What may be the reason ? Please specify. Not only for this PO for all other po's also it is showing
    like this.
    Regards,
    Bhadri M.

    Hi All,
    Thanks for the reply.
    After changing the properties of keyfigure also the decimal places are not coming in the query output. In listcube i checked for 0gr_qty, it is showing as 9.12 and the base unit is MT.
    In CUNI how to maintain the number of decimal places for the unit MT. I am unable to find this unit here.
    Regards,
    Bhadri M.

  • How to delete decimal point and adding leading zeros....

    Hi,
    I have one requirement in the report   i.e.
            <b>Present Value    :</b>  44567.98
            <b>Expected Value  :</b> 0000004456798
    In the present Value how will I remove that decimal point and how to add those six ing zeros. I tried with CONVERSION_EXIT....but it is not giving. Help me...
    Thanks in advance.
    Regards,
    Kumar.

    Hi,
    Use SPLIT and COMCATENATE fnctions.
    Eg:  split l_v at '.' into l_v1 l_v2
            concatenate l_v1 l_v2 into l_v.
    For adding leading zeros
    Use FM CONVERSION_EXIT_ALPHA_INPUT.
    Eg:
    data: tknum type vttk-tknum value '99156'.
    call function 'CONVERSION_EXIT_ALPHA_INPUT'
         exporting
              input  = tknum
         importing
              output = tknum.
    Sri
    Message was edited by:
            Sri Tayi

  • Remove decimal & zeros in variable

    Hi,
    How to remove zero & decimal point in variable
    for eg.
    insted 5.0000 it should priint 5
    Thanks

    Dear Imran,
    Please use this code and you can vary the difference.
    data: menge type MENGE_D,
          con type i,
          con1 type char5,
          con2 type p,
          con3 type n.
          menge = '100.00'.
          move menge to con.
          move menge to con1.
          move menge to con2.
          move menge to con3.
         con1 = menge.*
         con2 = menge.*
         con3 = menge.*
          write: 'i', con,
                 'char', con1,
                 'p', con2,
                 'n', con3.
    i think this will be help ful to you
    Regards,
    Kiran Kumar

  • RE: Reduce the Decimal Points

    Hi All,
    I need to reduce the decimal points.  my key figures are VGW01- Standard Value, VGW02- Standard Value, 
    0conf_act1  - Conf. activity 1, and 0conf_act2    Conf. activity 2 these are all data type as quantity. In report Data is coming 5.040,
    04.3234 like this so i have to reduce this decimal points, so could me give me answer for this scenario. And is there any routine needed for this.
    Thanks & Regards,
    Rajesh

    HI,
    First convert that value type to character, and then using WRITE TO statement you can move value to another one.
    if you need not to do any manipulations further
    because  character types can not be manipulated.
    or
    declare another  temporary valiable and then substract to 2 decimals, my suggestion is remove value from 2 dig from last.

  • Decimal points for Item Cost

    Hi,
    When i call out the query from OITM which has the average price (item cost), the result showed me in 2 decimal points. But in my item master data, it shows 3 decimal points. How can call out a query that shows 3 decimal points? Is there any condition i should use?
    Thanks,
    Rgds,
    Harith

    Hello Harith, I will test this issue on pl36 to see if it's reproducible. anyway, you are always suggested to patch up with the latest patch. I will let you know the result.
    Just tested and I got the same result as my previously reply, it shows 3 decimals witch complies with both general settings> decimal places for price and item cost in Item master data.
    please try to recall the Avgprice from OITW table to see what you get there.
    Thank you.
    Wilma Wang
    SAP Business One Forums Team

  • Format a number with a decimal to show the value but not the decimal point

    I have a value of 129.50 in the DB. I'm using the htp.prn() function to export this value to a txt file. I have the field padded with leading 0s (so it looks like 0000129.50)
    I need to keep the value for the .50 but don't want the decimal point to show up (so I need it to look like 000012950) but can't figure out how to make it keep the value for the .50 but not actually show the decimal point - any ideas? (APEX 4.0 11g)

    Multiply by 100 and remove the formatting. htp.prn (to_char (number_item, '99999999999'));
    Edited by: Kleber M on Sep 14, 2011 5:10 AM

Maybe you are looking for