Decimal in forms

Hi,
In one of the procedure i have to check for the decimal, eg. amount can be 100.25 or 100.00. How do i trap the decimal only.
Thanks in advance

select number - trunc(number) from dual
e.g. :
select 123.5 - trunc(123.5) from dual

Similar Messages

  • How do I round calculations to two decimal places (form-wide)

    Hi,
    I've created an order form where customers input the quantity of product they want to order and the form outputs the total due (including shipping and sales tax). Depending on user input, the resulting total sometimes contains more than two decimal places. How do I round calculations to two decimal places? Is there a way to do this form-wide?
    I'm new at using Acrobat for calculations. Any help would be greatly appreciated! Thanks...

    The above will affect the displayed value not the actual value of the field nor its value when accessed in another computation. This behavior may cause an error of 1 cent or more in the grand total or sales tax computation. If you want the the value and displayed value to be the same value you can use the following Validation script:
    event.value = util.scand("%,1 0.2f", event.value);

  • Decimal and non-decimal in Smartforms

    Hi all,
    I have a weird request on the form change. The change is to print the LFIMG value to 3 decimal point .000
    For example, if the value is 2,000.010, then print 2,000.010
    but if the value is 2,000.000 then print 2,000
    Could someone guide me how handle this request?
    Thanks in advance for the help.

    Hi Wong,
    I notice that this LFIMG is a quantity field. I had face that issue before, so this is my idea.
    1/ Try to discuss with you Functional consultant to take the standard of SAP firstly. it always isn't a good way to do that.
    2/ If your F tells you must do that:
    - Check the decimal setting of user in SU01
    - Write value base on this setting.
    You can refer below code:
    *&      Form  fg_decimal_notation
    *  Get decimal notation of current user
    *      -->P_USER     Current user
    *      -->P_DECIMAL  decimal notation
    FORM fg_decimal_notation USING p_user TYPE sy-uname
                                  CHANGING  p_decimal.
      DATA:
            lv_dec_notation TYPE usr01-dcpfm.
      SELECT SINGLE dcpfm
        INTO lv_dec_notation
        FROM usr01
        WHERE bname = sy-uname.
      IF sy-subrc = 0.
        CASE lv_dec_notation.
          WHEN 'X'.
            p_decimal = '.'.
          WHEN OTHERS.
            p_decimal = ','.
        ENDCASE.
      ELSE.
    *   If no record found we set the dec is ','
        p_decimal = ','.
      ENDIF.
    ENDFORM.                    "fg_decimal_notation
    *&      Form  f_convert_number
    *  Convert number to text with or without decimal
    *      -->PI_VALUE   Value
    *      -->PI_DECIMAL decimal
    *      -->PO_TEXT    Result
    FORM f_convert_quantity_to_text USING pi_value
                                          pi_decimal
                                          pi_unit
                          CHANGING po_text TYPE text30.
      DATA:
            lv_text TYPE text30,
            lv_string TYPE string.
    *-- write to external value
      TRY.
          WRITE pi_value TO lv_text UNIT pi_unit.
        CATCH cx_root.
      ENDTRY.
      CONDENSE lv_text.
    * Put sign to front
      CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
        CHANGING
          value = lv_text.
    * Move to string
      MOVE lv_text TO lv_string.
    *-- shift delete 0 in trail and decimal number
      FIND pi_decimal IN lv_text.
      IF sy-subrc = 0.
        SHIFT lv_string RIGHT DELETING TRAILING '0'.
        SHIFT lv_string RIGHT DELETING TRAILING pi_decimal.
      ENDIF.
    *-- move result to data
      MOVE lv_string TO po_text.
    ENDFORM.                    "f_convert_number
    Hope that help,
    Regards

  • Issues with Decimals

    I have an issue with decimals in calculation : -
    Data : G_SUM TYPE p DECIMALS 2.
       KOMV-KBETR = 2.00  (KBETR TYPE IS P(6) Decimal 2)
       WG_A650-ZZBILL_QUNT = 10.00 (ZZBILL_QUNT Type is P(7) Decimal 3)
            Loop at I_A650 into WG_A650.
                 G_SUM = G_SUM + ( KOMV-KBETR * WG_A650-ZZBILL_QUNT ).
            Endloop.
               XKWERT = G_SUM. (XKWERT Type is P(7) Decimal 2)
    Form the above calculation : - G_SUM should be 20.00
             But the result is : -  20000.00
    To aviod this i changed the declartion of G_SUM as below : -
    Data : G_SUM TYPE p DECIMALS 5.
    Now it is calculating correctly but i need to assign this value to a another field.
          Its data type is (TYPE p DECIMALS 2)
    Now the result is again changed to 20000.00
    Any sugesstion to fix this issue will be apprecaiated.
    Regards,
    Kittu

    Hi Florian Kemmer,
    Thank you for your quick response!
    It is my mistake, i could have explained in more efficient manner. 
    The below values are from Internal table only and it has only 1 record.
    KOMV-KBETR = 2.00    
       WG_A650-ZZBILL_QUNT = 10.00
    (G_SUM = G_SUM + ( KOMV-KBETR * WG_A650-ZZBILL_QUNT ).)
    After the above formula is executed it shoudl display the value as 20.00
    Due to issues with the decimals it is displaying as 20000.00
    And the declaration is not exactly done as described...It is just for understanding.
    KBETR --> is of type  P(6) Decimal 2.
    Any suggestion will be appreciated
    Regards,
    Kittu
    Edited by: Kittu on Mar 29, 2010 12:34 PM

  • Change the demical point in layout create PO in field net price

    hai frineds,
    can we extend the net price decimal point form two to 4 decimal point?

    Better you use "per" unit price rather that change the decimal currency, eg: 2500 USD per 1000PC, you can read several thread that similiar with your question:
    Re: Purchase price to have 4 digits after decimal point
    Decimal Place
    decimal places in Purchase orders

  • BigDecimal and POW

    Hello
    In the following example, I compute new_amount_d in 2 different ways and I get 2 different values although it should be the same in theory.
    Is there a way to get the same value with BigDecimal for instance ?
    I'm new to Java and I'm working for financial industry...that's why I'm trying to solve this problem.
    Thanks for helping.
    public class num004
    public static void main(String[] args)
              double amount_d = 1000;
              double interest_rate_d = 0.03;
              double new_amount_d = amount_d;
    for(int i = 0;i<365;i++)
              new_amount_d = new_amount_d * Math.pow(1+interest_rate_d,(double)1/365);
              System.out.println("new amount_d :"+new_amount_d);
              new_amount_d = amount_d * Math.pow(1+interest_rate_d,(double) 1);
              System.out.println("new amount_d :"+new_amount_d);          
    }

    please add tags around your samples when posting here...
    The wrong result is cause by your double values.
    native decimal numbers are not precise because of two resons:
    <ol><li>there is s limmited number of bits/bytes to represent the value.
    <li>binary representation used by the Computer differs from human readable decimal format in that way that some decimal fractions form entless binary fractions, wich connot be represented due to leck of bits/bytes
    </ol>
    Use only <tt>BigDecimal</tt> objects and their methods for calulation.
    bye
    TPD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Decimal for a weight field and form calc on a table - header text

    Hi Guys,
    Need your help on 4 issues I am facing.
    1) I am using a Quantity field and till interface the value is 100.000 but in adobeform print its showing 100. How to get decimals printed.
    2) in item details there is a another quantity field and in old script its printed as &VBPLP-VEMNG&(7.0) but the field length is 12 and 3 decimals. If I am directly making limit leading digits to 7 then in output the values is printed as 0.
    3) In item details printing there is a last field weight which is also decimal field. user wants to print this field value text(Weight) only when a text field value has "X". I got it perfectly getting printed if value is "X" and is not getting printed when its space. but the issue is the text weight is not getting printed only at first page and for subsequent pages the weight is getting printed. In what event I have to write the code for this scenario and currently I had written code in initialize.
    Item Layout :
    If a value of interface field is "X" the output should be
    ID  | Material no | PO no  | SO no | Qty  | unit | Weight  |
    If the value of interface field is " " the output should be
    ID  | Material no | PO no  | SO no | Qty  | unit |
    4) After completion of item details there is a requirement to print 2 standard texts. If 1st standard text has no value then it should print space and the next standard text text and value should move up and display. currently i had kept  text1,std text value1,text2,std text value2 in flowed subform only.
    Awaiting for corrections......

    Hi Guys,
    The issue got solved. I am sharing the solution so that it may be useful for others.
    1) solved by using pattern - num{$z,zzz9.999}
    2) not necessary
    3) In Pagination tab of header - you need to check the check box - keep previous , keep next.
    4) have to make the text box to fit a single line and check box multiple lines and keep each standard text in a flowed sub form. Now if 1 st standard text is blank then second standard text will come up.
    Thanks
    Abilash

  • PDF Forms: problem with keypad "decimal dot" when filling "number" fields

    Ok, here's my problem :
    I've created a form with fields. My client want to input in those fields amount of money. So I've created fields formatted with the "Number" category. 2 decimals, "1234,56" separator style, not currency symbol. So far, so good!
    When testing out the form, here's what happening :
    On the computer that I've created the form (iMac, Acrobat Pro and Reader, french canadian keyboard layout and system)
    Using the keypad, I can input numbers, with the "decimal point" from the keypad no problem.
    But when the client is trying to to the same on his PC (and the same is happening with my PC at home, Acrobat Pro 9.2, french canadian keyboard layout and system), I CAN'T use the "decimal point" keypad key to input numbers (like 43,25). It's just not working (error sound). I can however use the "dot" on the keyboard near the "M" key, but the client don't want to do that.
    Why is it working on the Mac, but not on the PC's!?
    So far, the only workaround that I've found is to set the "money" fields categories to "none" instead of "number.

    It is a little bit tricky, but you might have to add your own formatting handler. You would proceed as follows:
    1. Set the Format to "none".
    2. Add the following script to a Custom Keystroke event:
    if (event.change.length > 0 && event.willCommit == false) {event.change = event.change.replace(/\,/gim, ".") ;
    3. Add the following script to a Custom Format event:
    event.value = event.value.toString().replace(/\./gim, ",") ;
    And that should take care of the situation.
    Note that i have not tested the scripts, and there may be a chance for bugs.
    The advantage of this solution is that internally, you will have the correct format for a number, so that calculations will be correct.
    Hope this can help.
    Max Wyss.

  • Decimal Point Validation in Oracle Forms 6i

    One of my table has a column named interest. Data type of this column is number (4,1) so it can hold 99.9 and 100 both.
    If user enters 9.99, oracle form accepts the values and rounds it to 10. When scale defined for this data type is 1 so user shouldn’t be allowed entering 2 digits after decimal.
    I would like oracle to give error stating that user can enter upto 1 decimal place only so 9.99 is invalid input. Is there any function in oracle form (D2k)that let you know how many digits user has entered after decimal?
    Is there any function in oracle form (D2k) that let you know the length of input ?

    Hi
    Why don't u use Format mask property for the same,so it will not allow user for wrong i/p
    alternatively use forms message to display pop-up .
    Rgds
    NP

  • Decimal conversion of Sales Tax in 'SPARE PARTS SALE INVOICE' ( smart form)

    Hello,
    I am displaying a the value of the Sales Taxc in 'SPARE PARTS SALE INVOICE'. (in Smart Form)
    The field(which holds the Sales Tax value is 'KWERT' -LBBIL_INVOICE-IT_KOND ), with datatype 'CURR', reference table 'KOMK' and reference field 'WAERK'.
    In my smart form,i have declared a variable 'SALES_VALUE' of datatype 'KWERT' and reference field 'IT_PRICE-WAERK' (LBBIL_INVOICE-IT_PRICE), where 'WAERK' is the SD document currency.
    Now when i display the field 'SALES_VALUE' i get 735.00 , whereas the original value in the field is 73.5
    how to correct this and where am i wrong ?
    Thankyou for yur time and really appreciate the help.
    Shehryar

    You are using currency fields that reference a currency code. Most currencies in SAP have two decimal places. Dividing by 100 will work in most cases. Ideally you should get the CURRDEC value in table TCURX for the currency you are working with... then divide by 10 that number of times.
    example-
    USD, 2 decimals, divide by 10 twice.
    There is a function module that will do this for you. Can't think of the name...???

  • Decimal places in form

    Dear Gurus.
    I need to display dinamic decimal places in my form.
    for example if I have a variable containing value:
    1.500  - need to display it as 1.5 (omitting trailling zeroes)
    1.520  - need to display it as 1.52,
    1.000  - need to display it as 1
    please help.
    Thanks & Regards,
    William Prawira.

    Hi,
    you need to write program lines in order to check the first,second and thrid decimal places with the following code and then display accrodingly the values.
    LV_DEC_PART = FRAC( TABLE-FIELD ).
    then in insert three text nodes with the same field with offsets.
    &TABLE-FIELD.0&  with the condition LV_DEC_PART+0(1) = 0.
    &TABLE-FIELD.1&  with the condition LV_DEC_PART0(2) = 0 AND LV_DEC_PART0(1) # 0.
    &TABLE-FIELD.2&  with the condition LV_DEC_PART0(3) = 0 AND LV_DEC_PART0(1) # 0 AND LV_DEC_PART+0(2) # 0.
    Hope this is clear.
    Regards,
    Ram

  • Aodbe form Numeric or Decimal Field

    Hi experts,
                 I am new to adobe form. I want to display, if i enter 1234 ,it will be displayed 12.34 .Can you please suggest me?
    Thnaks.
    Hans

    Hi Hans Bauer,
    Do the following:
    1. Take the field as Numeric Field or Decimal field from Library.
    2. Select the field from Hierarchy.
    3. Go to menu> windows> Script Editor.
    4. Choose Exit event in the script editor.
    5. now write the following code in the exit event of the numeric field/decimal field.
    $.rawValue = $.rawValue/100
    Thats all what you have to do.
    Hope it will solve your problem.
    Regards,
    Vaibhav Tiwari.

  • Decimal places when exporting HFM form to Excel

    Hi All,
    We are on HFM 9.3.1.3.
    From the web, when we export a data form to Excel, we lose the decimal places.
    In our data form we use 3 decimal places, however all exports to Excel deafult to 0 decimal places. We can reproduce in Excel 2003 and 2007.
    Is there a setting we can change so that an export to Excel picks up the decimal places used in the data form?
    Thanks for your help.
    Seb

    Hi,
    Thanks for the reply. I just checked and both settings are the same:
    decimal separator is a . in the server's regional settings and user preferences.
    I have tried changing the regional settings to no avail.
    The strange thing is that if I connect from my laptop to another 9.3.1 environment then I can export to excel with the correct decimal places.
    I'd say this is definitely an environment issue.
    Thanks again for your help.
    Seb

  • Decimal Notation in Forms as per his SAP Decimal Notation

    Hi,
    We need to display all numeric fields in the Adobe Form as per the Decimal notation of the User in his SAP user defaults.
    Also, we need to take care that the currencies have current decimal places.
    Please let us know if this is achievable in Adobe Forms. Is there a way we can set the number format of a field dynamically in Adobe.
    Any pointers in this regard is highly appreciated.....Thanks in Advance.,
    Raghavendra

    Hi Raghavendra,
    to be bale to decide in your abap-printprogram, which format to use for printing, you can read the decimals and number format from customizing (or user) and then pass into form through an additional interface parameter format_string of i.e. CHAR060.
    Place your format string in a hidden textfield on your form
    This format string can then be used in the adobe form to format the text-field using script:
    this.format.picture = your_hidden_textfield.rawValue;
    we do so for date-formats and currency-formatting we read out of the country customizing.
    regards

  • Opening web form in SmartView 11.1.2 - decimal formatting

    I have a web form that consist of regular rows (accounts) and formula rows. The form is setup to display minimum 0 and maximum 2 decimal places for all cell types and this format is correct when I display the web form in Planning. However, when I open this web form through SmartView, these cell type precision does not retain. In fact, it always display round up whole number for regular rows and 2 decimal places for formula rows. Is this a default for SmartView? I am aware of the setting in Options > Formatting that allows me to change the decimal places, but it seems to apply to the entire grid instead of a particular row.
    My client is very specific on their format and they want to open up the web form via SmartView. Ideally we want the format that shows up in Planning to be the same in SmartView. It will be greatly appreciated if anyone can shed some light whether this can be done or not.
    Thanks,
    Kelly

    Click on File>Preferences in the workspace and you get the preferences window. If you choose Planning from the left hand side, then navigate to the "Display Options" tab, you can change the "Allow Search When Number of Pages Exceeds:" setting to be a very high number (e.g. 99999999). Click OK and return to the form and you will be presented with a "normal" drop down list. Note this is a global setting for every form.
    Regards
    Ed

Maybe you are looking for

  • Bpm process is not shown on bpm workspace but i see exception on the server

    Hi Gurus, When i try to deploy a simple BPM composite i am getting below exception. deployment goes fine but when you open BPM workspace to initiate a instance , bpm process is not shown on bpm workspace instead i see below below error can anybody he

  • Set Password for Custom application

    HI all, I want to set password in my zdevelopment. I have a screen where user first need to keep password and then only he should be able to process further. Now my query is how to encrypt the password. Kindly guide....

  • IPod Video not connecting

    I have a 30gb iPod Video and when I plug it up to the cable nothing happens. Windows doesnt see it and neither does iTunes and the iPod itself doesnt light up when it's plugged in. But when I unplug the cable from the iPod(its still connected to the

  • Client Certification for Sender SOAP Adapter

    I am trying to configure an incoming SOAP call to allow client certification for autentication and not ask for username/pwd. I already tried changing the configuration of the SOAP adater in visual admin to have the client certification module with no

  • CCMSPING and auto-reaction alert

    Hi, helppppp....pleasee..... We have use our solution manager system as the central monitoring system (CEN) for the satellite system In this case, the ccmsping agent is running on the CEN. If the satellite system becomes unavailable, the CEN will aut