Retain trailing zero's after decimal

Hi,
i have a requirement to retain trailing zero's after decimal....
is it possible?
version: 9.2.0.7
example: select 150.200 from dual;
we will get 150.2 as output.
but i need 150.200 as the output...
how would i do this?

oraDBA2 wrote:
Hi tony,
sorry, that is not the constant value...that is a variable based on the value, what user enters with the decimals.......if i understood you correctly,
it seems like you will need to use char or varchar2 datatypes in that table to start doing what you would like to do in the way you wan't it.
and still you have option to apply to_number and to_char on that varchar2 column.
SQL> create table b (charr varchar2(15) );
Table created.
SQL>
SQL>
SQL> insert into b (charr) values ('1000.000');
1 row created.
SQL> commit;
Commit complete.
SQL> select* from b;
CHARR
1000.000
http://stanford.edu/dept/itss/docs/oracle/10g/appdev.101/b10795/adfns_ty.htm#1006325

Similar Messages

  • How to remove trailing zeros from a decimal (type) value?

    Hi Everyone,
    I would like to 'drop' some trailing zeros from a decimal value, e.g.: 50.000000, and I am wondering how to go about this?
    The value is definitely of decimal type, and in this instance I know that I want to eliminate exactly six (6) zeros.
    Any help here will be greatly appreciated.
    Kind Regards,
    David

    Try the below:
    This is sort of a display issue, you may do it at Application side, which would be efficient.
    Declare @s Decimal(10,6)='50.0000000'
    Select Cast(@s as decimal(10,0))

  • How can i retain the trailing zeroes after decimal

    how can i retain the trailling zeros after decimal?
    values are showing in table like( 4.50,5.00) but i am trying to do some processing with these values then ithe zeroes are truncated like (4.5,5),
    how can i get values with zeroes

    If the values in the table have trailing zeroes, it's a character type column.
    Once you perform operations on them, they're implicitely converted to the number type, hence "losing" trailing zeroes.
    To get the trailing zeroes back, you have to convert them back to character data:
    TO_CHAR(1.5*3, '90d99')Have fun,
    K.

  • How to delete trailing zeros after decimal ?

    Hi,
    i want to delete trailing zeros after decimal.
    Example:
    if it is 22.000 then output will be 22
    if it is 22.010 then output will be 22.01.
    plz let me know hw to do this ?

    DATA:
      lv_decimal TYPE f DECIMALS 3,
      lv_string  TYPE string.
    lv_decimal = '22.010'.
    WRITE lv_decimal TO lv_string.
    SHIFT lv_string RIGHT DELETING TRAILING '0'.
    CONDENSE lv_string NO-GAPS.
    * now no trailing zeros are in the decimal stored in LV_STRING
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Jan 30, 2008 12:10 PM

  • Trailing zeroes after the decimal

    I have a program that I have to do maintenance. One of the complaints is that a "rate" field is showing the trailing zeroes. The data type is 10.6 DEC. It was embedded in screen painter. Is there something I can do to change the output to suppress trailing zeroes. If the rate is 1.24, it shows it as 1.240000.
    Thanks for your input.
    Steve

    Hi,
    You can do like this
    DATA:
      lv_decimal TYPE f DECIMALS 6,
      lv_string  TYPE string.
    lv_decimal = '1.240000'.
    WRITE lv_decimal TO lv_string.
    SHIFT lv_string RIGHT DELETING TRAILING '0'.
    CONDENSE lv_string NO-GAPS.
    write: lv_string.
    Regards,
    Satish

  • Eliminating zeroes after decimal

    HI all,
      I have a requirement to delete the trailing zeroes after decimal.
      It is a interest rate and it is denoted in EUR.
      i.e the number is 0,739000 % Internal declaration of this number is in DEC.
      the data type is AZINSSATZ.
    i want it to be displayed as 0,739 %
    How can i eliminate these zeroes?
    Thanx in Advance
    Regards,
    Hamsa Priya

    Hi Hamsa Priya,
    To remove leading zeros and leading blanks
    Please use FM
    CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
    CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
    Ex :
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                EXPORTING
                  input  = wf_version
                IMPORTING
                  output = wf_version.
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • Zeroes after Decimal

    Hi,
    I am having a value as  '6009.12300 ML'  belongs to type C.
    Now i don't want the zeroes after decimal such as 6009.123 ML .
    how cud i do this?
    i tried search ,split,shift,trailing zeroes but could nt get it?
    Thanks,
    Ponraj.s.

    Hi,
      I tested the following code segment, it works well to suit your requirement.
    Just look at the code.
    DATA C(20) VALUE '6009.12300 ML'.
    DATA:  LEN TYPE I,
               FLAG TYPE I.
    LEN = STRLEN( C ).
    DO LEN TIMES.
      LEN = LEN - 1 .
      IF ( C+LEN(1) EQ '0' ) .
        C+LEN(1) = ' ' .
        FLAG = 1 .
      ELSE.
        IF FLAG = 1 .
          EXIT .
        ENDIF .
      ENDIF .
    ENDDO.
    CONDENSE C NO-GAPS.
    WRITE C.
    Reward if helpful.
    Regards,
    Sandhya

  • 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

  • Suppressing zeroes after decimal

    Hi
    I need to suppress the zeroes after the decimal places in my form output if 00 appears after decimal.
    eg 123.00 shd be displayed as 123 .
         123.23 shd be dispalyed as 123.23.
    Could anyone help me with this
    TIA
    Regards

    hi Ankur do this way
    data: wa_input  type i,     
          wa_output type i.
    wa_input = '1.000'.
    CALL FUNCTION 'ROUND' 
      EXPORTING   
        INPUT              = wa_input
      IMPORTING  
        OUTPUT             = wa_output
      EXCEPTIONS
       INPUT_INVALID       = 1
       OVERFLOW            = 2
       TYPE_INVALID        = 3
       OTHERS              = 4.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write:/ wa_output.

  • Zeroes after decimal getting trimmed after 1:1 mapping of EDIFACT

    hi all
    i have created 1:1 mapping for XML->EDI.
    i took the output from XI and gave it as input.However, in the output of the mapping, the zeroes after decimal are getting deleted.
    for example if the input contain 2500.000, the output of the mapping contains 2500.
    I want 2500.000 in the output.
    Any suggestions as how to overcome the problem?

    hi Kai
    sorry ..i think i didnt convey properly my prob.
    This is what i want.
    My scenario is IDOC->EDIFACT using XI.
    i did a XI graphical mapping from IDOC ->to->EDIFACT_XML.Here for a particular field i got the output as 2500.000.
    Now this EDIFACT_XML is converted into EDIFACt using 1:1 mapping of BIC MD.
    When i give 2500.00 as an input to this 1:1 Mapping of BIC MD, the output contains only 2500.
    I'm not having problem in XI but in BIC MD.
    kindly suggest how i can get decimal output from BIC MD.

  • LEADING ZEROS AFTER DECIMAL

    Hi
    I want to remove leading zeros after decimal what should i do for that?.
    suppose lets thing my field is VAR and it gives value 150.000 and now i want to remove the zeros after decimal

    QMEL-QMNUM is a character 12 field, which internal format has leading zeros, simplest way to remove the leading zeros is to shift left.
    loop iords.
    shift iords-qmnum left deleting leading '0'.
    modify iords.
    endloop.
    can either use this function module also
    CONVERSION_EXIT_ALPHA_OUTPUT
    or
    SHIFT <yourField> LEFT DELETING LEADING '0'
    or
    try NO-ZERO option of WRITE statement
    or
    Another way is to create another variable of type I and assign the value into it
    example:
    DATA: L_NUMC(08) TYPE N.
    DATA: L_INT TYPE I.
    L_NUMC = '00000018'.
    L_INT = L_NUMC.
    Result will be = 18.

  • Retaining leading zero after sum operation

    I have a variable g = 00000005. Now when I am adding g = g + 1.
    The result is coming 6 but without leading zeroes.How could I retain leading zero after sum operation.

    Hi Priya,
    Declare the g as type N.. then do sum.. okay..
    ex :
    data : d(7) type n value '0000005'.
      g = g + 1.
    write : g.
    output is : 0000006.
    Raghunath.S

  • How to keep the zero after decimal

    Hi,
    I'm trying to store numbers into one of the custom table column. This column must contain unique value for each record.
    Now the issue is if i want to insert a record with zero after decimal point its removing that zero.
    Emp Id (number)
    1234.1
    1234.2
    1234.9
    1234.10 --> 1234.1 (this is what is getting stored in table)
    1234.11
    ...I want to store 1234.10 not 1234.1, is there any way that i can store zeros as well after decimal point for NUMBER data type column.
    Thanks in advance,

    Hi,
    Your appending sequence number should be with leading zeroes like
    1.001
    1.002
    1.003
    1.009
    1.01
    1.011 etc
    based on the numbe rof records you haveTry this and see if this fits for you
    DECLARE
       CURSOR c1 IS SELECT * FROM custom_table1;
       i              NUMBER;
       l_len          NUMBER;
    BEGIN
       SELECT LENGTH (COUNT (*))+(LENGTH(some_seq.currval)-1) INTO l_len FROM custom_table1;
       FOR c1_rec IN c1
       LOOP
          i           := some_seq.NEXTVAL;
          INSERT INTO test_tab (ID, NAME, amount, create_date)
               VALUES (c1_rec.ID || '.' || TO_CHAR (i, rpad ('0', l_len, '0') || '9')
                      ,c1_rec.NAME
                      ,c1_rec.amount
                      ,c1_rec.create_date);
       END LOOP;
    END;G.

  • How to delete Trailing zeros in a string array

    I am reading data from RS232 port and storing the values in an array of 16 nos. Then converting the array of numbers into string using 'number to fractional string" function with precession 2  and sending the data string to Table. I am printing this table further for report generation.
    I am unable to remove the trailing zeros as i am defining precession 2 which is not needed for all the numbers in the table.
    Please help me how to remove the trailing zeros after decimal point which is very much necessary for report generation.
    regards
    Prasanna Kumar N M

    Use format into string in a FOR loop with a format specified of %#f. See attached example (LabVIEW 7.0)
    Message Edited by altenbach on 10-14-2006 05:40 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    AutoFormat.vi ‏17 KB
    AutoFormat.png ‏3 KB

  • IHow to force display of trailing zeros for fixed point numbers?

    I have an 8 bit unsigned fixed point number, with 7 integer bits and 1 fractional bit, so the desired delta is 0.5. I want it to always display the fractional bit, even when that bit is 0. In other words, as this number is incremented, I want to see:
    0.0
    0.5
    1.0
    1.5
    etc.
    But instead I'm seeing:
    0
    0.5
    1
    1.5
    etc.
    I set the display format to Floating point, with 1 digit of precision. The "Hide trailing zeros" checkbox is NOT checked. What am I doing wrong?
    I realize I could convert to single precision for display purposes to make this happen, but I'd rather make this work with fixed point.
    Thanks,
    -Ron

    I just rustled up a VI with what I understand your input to be - unsigned 7 bit mantissa and 1 bit exponent input, and have it displaying 2 decimal places.... Is this what you're after or did I miss it?
    - Cheers, Ed
    Attachments:
    zeros.vi ‏7 KB

Maybe you are looking for

  • Email through report

    Hello All, I have done the z report in which i have called a function module so_new_send o send an email. I am able to post an email from report to SOST transaction but from there a mail is not triggered.The status of the email is waiting for communi

  • Connecting Apple TV to Livebox network

    I'm trying to connect Apple TV to and Orange Livebox wireless router. It sees the router , I enter the WEP key but it can't log onto the network. I'd really appreciate any tips on getting this sorted.

  • Contribute CS4 Paste/Insert Issues

    I hope someone can help with this. We are having an issue where we can't paste/insert anything having to do with HTML into a nested template in Contribute CS4. If we select text from notepad and paste or "Paste Text Only" from Contribute, it works gr

  • Sales order field Non Editable

    Dear All, how to make  sales order field -payment terms non editable to the end  users we do not want the endusers to change the payment terms proposed from the customer master With regards Mohammed Raees

  • Performance issue after 10G upgrade.

    All, We recently upgraded to 10G (Version:10.2.0.3.0) after which the below query causing the problem. This query is written in a pl/sql package called by a Perl program. The Perl program is running forever without completion during some attempts and