How to find decimal place?

If I have a number such as:
123.45
how can I figure out that the number has a decimal point greater then 0? I just want to isolate the decimal part and compare it's value, but I'm not sure what a good way to do that would be. My first thought was to change it to a string and then back again, but I'm not sure if that is a good way.
Message was edited by:
bclark

public class Test
     public static void main(String args[])
          double number = 123.45;
          int intValue = (int)number;
          System.out.println( number > intValue );
          number = 123.00;
          intValue = (int)number;
          System.out.println( number > intValue );
}

Similar Messages

  • How to maintain decimal places in BOM Qty & what is the essence of base qty

    Hello PP members
    How to maintain decimal places in BOM Qty & what is the essence of base quantity in BOM ?
    Thank You

    ur first question is not understood, You can have maximum of 3 decimals in BOM item qty.
    Base qty is the qty which is refered to all the BOM items.
    example -
    Product X, base qty 1
    Raw material 1 - componen t qty= 1
    Raw material 2 - Component qty= 5
    This means To produce Product with qty1, it needs raw material 1 qty 1  and raw material 2 qty 5.
    This means To produce Product with qty10, it needs raw material 1 qty 10  and raw material 2 qty 50.
    This is the meaning of Base qty..it is the referece qty refered to all the components.
    About the decimal places
    let us say  example 2
    To produce Product with qty1, it needs raw material 1 qty 1  and raw material 2 qty .0001.
    When you enter this in SAP for the raw materialm 2 system will give error message that you  need to enter the qty with maximum 3 decimal places, hence you need to enter as below
    Product with qty10, it needs raw material 1 qty 10  and raw material 2 qty .001.
    This is how you need to adjsut the base qty and component qty with decimalplaces moer than 3,
    pl come back

  • How to find the place of manufacture?

    How to find the place of manufacture?

    For your own information, you could try & check with one of the online identify-by-serial-number
    services; no telling what they may use any information (of yours) they may get from an inquiry...
    I'd used this one a few times and with a Serial number, it does show a place of manufacture;
    but with only a Model number, it does not say much about when or where it was made... in
    fact the model number goes to an older model, too; what I see w/ Model number is not Retina.
    •Identify your Mac - Lookup your unit by Apple Serial number, or Model Number:
    https://www.powerbookmedic.com/identify-mac-serial.php
    According to http://MacTracker.ca database, a MacBook Pro, Retina, 15-inch, Mid-2014, has a
    has a Model number of A1398 and EMC 2876 and had one of three different processors.
    Not sure if this helps, but assembled in China is usual information on many of those. Some
    versions with added parts or 'custom built orders' may have a different point of final assembly.
    And if you receive the computer via a parcel delivery company, sometimes their web site or
    tracking information on your specific order will show the path it took to get from you. If the
    item was stocked in a region nearer you than the point of manufacture, or a main warehouse
    the item could have been shipped from another location where they had additional inventory.
    Hopefully you can find the details you need.
    Good luck & happy computing!

  • How to decrease decimal places in invoices

    Good day,
    How do i drecrease decimal places in invoices. For example , i have set the decimal places to 4 for costing purposes but i want the final invoice to be 2 decimal places for display purposes. i have tried decreasing the decimals using the decrease decimals icon but the decimals are still 4.
    Thanks

    Hi Wendy,
    This is System Standard that If you increased Decimal Place then you can not decrease those decimal Place again.
    If you want this then you can do this in (Print of Document) Document Layout through Crystal Report.
    Hope this help
    Regards::::
    Atul Chakraborty

  • How to allows decimal place for unit of measure of order confirmation

    Hi Guys
    we have some special cases here that need to confirm the order quantity as decimal place,is that possible made some customizing in code CO11N? or have some ways support it .....
    ex. work order A   10 EA
    - operation 1   : colse 10 EA
    - operation 2   : close 4.5 EA
    Regards/Eric

    Hi,
    You can set a UoM to allow decimals in transaction CUNI. But i fail to understand why you would want to set EA to have decimals.
    If a material is to be managed in decimals then evaluate the usage of a different UoM which allows for decimals.
    Regards,
    Vivek

  • In VC WEBDYNPRO compiler mode, how to set decimal places to 2

    The compiler mode is webdynpro,
    The ivew table column's data type is num type,
    The column show a curreny data.
    Now the problem is when the num data is like a number as "1000.00",the ".00" will not show,but when the value is "1000.01" ,it show "1000.01". I want it always show  the formatting like "X.XX".
    There is also no formatting property to set in the column like in flash compiler mode then i can set decimal places to 2.
    What should i do?

    Hi,
    You can use Decimal Format Class and declare something like:
    DecimalFormat df = new DecimalFormat("#,##0.00;(#,##0.00)");
    wdContext.currentContextElement().setSueldoTxt(df.format(wdContext.currentOutputSueldoElement().getPe_Betrg()));
    You'll have the two decimals...!!
    Good Luck and regards,
    Maria Margarita Monteverde

  • How to concetenate decimal place

    hi
    i have declared a variable as
    var_ad_addtn(16)  TYPE p  DECIMALS 10.
    now the value is coming as two decimal place i want to truncate the decimal place and only show as integer but i cannot declare like integare and the field value passed to this variable is type curr and upto two decimal place
    what i am doing is var_ad_addtn+(.0). but this is not working please let me know the syntex and statement for truncating and not display the decimal place value from a value
    eg 1232834.90 i want to show as 1232834 only
    regards
    arora

    Hi Nishant,
    Then try the following fucntion modules:
    HR_NZ_ROUNDING_DECIMALS
    ROUND
    CALL FUNCTION 'ROUND'
        EXPORTING
          DECIMALS      = 0
          INPUT         = var1
          SIGN          = '-'
        IMPORTING
          OUTPUT        = var1
        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.
    Regards,
    Chandra Sekhar

  • Casting Number as Char - how to hide decimal places?

    I am casting a number as a Char because I am concatenating it with other things. The problem is that when I cast to char, it displays two decimal places of just 0's. I really don't want to show the decimal place or anything after it. Is there a way to remove them?
    Thanks

    Hi,
    You can have two approaches for the same.
    1> cast( cast(column as int) as char)
    2> Go to the column properties(i.e the finger mark on the coulmn heading). Then select the data format tab and check the override the default data format tab. Then you can set the decimal places.

  • How to avoid decimal places in smartorms

    hi friends,
    i have to display a field VBAP-KWMENG (order quantity) in samrt forms it has a value 1.000  but it is display ing as 1,000.
    how can i avoid those zeroes after the 1 my req is to print 1.
    KWMENG is a data element with packed decimal as (15,3).
    i tried VBAP-KWMENG(Z), VBAP-KWMENG(T) , VBAP-(KWMENG(K),
    but it is not supprssing those zeroes.
    pls urgent........
    thanks in advance.
    VENUMADHAV

    Hi
    Declare a local Variable in the program line.
    L_display of type char .
    Pass 1 to l_display .
    In the ouput field pass &l_display& .
    Hope this helps .
    Praveen

  • How to change decimal places in currency

    Hello ,
    I am an abapers,I Have one problem while displaying the currency fields in my Report.
    My problem is In Fbl5n,it displaying amounts as 50,000 for document number,
    But in my database,It is storing as 500,00 for that document number.I need to store the amount as 50,000. is there any settings to be changed to solve this problems
    For this how can i solve this problem.
    Waiting for your favourable reply
    Regards
    Maruthi

    Hi
    You can change your profile in SU3 transacton.
    Thanks
    Ashok
    Assign points for useful answer

  • SQL*Loader how to handle decimal place

    Hi all
    I need to load data into table with number field (12,2)
    however, the source data is 1,025.02. Then the data cannot be loaded and in log, there is error message Invalid Number
    Please kindly advise how to handle this in control file?
    Thanks
    Thomas

    load data
    ,YOUR_NUMBER_COLUMN .... ... ... " to_number(:YOUR_NUMBER_COLUMN,'999G999D99' , 'NLS_NUMERIC_CHARACTERS=''.,'' ')"
    )

  • How to correct decimal places in script

    Hi,
    I have a packed integer variable. The value stored in that variable is 8,156,265.598.
    But i want it as 8.59 in the form.
    How to achieve this?
    Ezhil.

    use [this link|http://help.sap.com/saphelp_nw04/helpdata/en/1c/f40c6fddf311d3b574006094192fe3/content.htm] on formating numerics fields for display.. [<click>|http://help.sap.com/saphelp_nw04/helpdata/en/1c/f40c6fddf311d3b574006094192fe3/content.htm]

  • Set Decimal Places in a swing

    Ok so i know how to set decimal places in a applet and a command prompt type build but in a GUI i am trying to set them and it isnt working my code is:
    doc.insertString(doc.getLength(), strFICA[j] + "\t", textPane.getStyle("regular"));
    i went and added the information
    Decimal Format twoDigits = new Decimal Format("000.0");
    doc.insertString(doc.getLength(), twoDigits.Format (strFICA[j]) + "\t", textPane.getStyle("regular"));
    it gives me the error cannot find symbol
    symbol: method Format(java.land.String)
    Lacation: Class java.text.DecimalFormat
    doc.insertString(doc.getLength(), twoDigits.Format (strFICA[j]) + "\t", textPane.getStyle("regular"));
    ^
    what does this mean and help will be great

    Help given here is voluntary and people do try hard, but your questions are as unintelligible as they are naive. You really need to do some ground work first by reading the tutorials and trying things out for yourself before posting here.
    Those that get the most help are those that demonstrate they are willing to help themselves more than you seem to be.

  • Save data with more than 6 decimal places in SAP MDM 5.5

    Hi there,
    I need some help concerning saving data with about 20 decimal places (e.g. 0,00452961328622164) in MDM. I declared the datatyp "REAL", there are only 6 decimal places possible.
    How can I save this Data? Maybe exponential function?
    Please help.
    Thank you
    Thomas Pfab

    currency takes you to 14 decimal places, if you want to have it as a little work around....you can always take out that symbol if it is annoying.(ohhh and decimal is multilingual too in currency, probably not a good hack!)
    or without even knwoing what your requirement is? try normalizing the value, How many more decimal places can you hit?
    One 100 1. "ten to the zero"
    tenth 10-1 0.1 "ten to the minus one"
    hundredth 10-2 0.01. "ten to the minus two"
    thousandth 10-3 0.001. "ten to the minus three"
    ten thousand 10-4 0.0001. "ten to the minus four"
    hundred thousandth 10-5 0.00001. "ten to the minus five"
    millionth 10-6 0.000001 "ten to the minus six"
    ten millionth 10-7 0.0000001. "ten to the minus seven"
    hundred millionth 10-8 0.00000001. "ten to the minus eight"
    billionth 10-9 0.000000001. "ten to the minus nine"
    ten billionth 10-10 0.0000000001. "ten to the minus ten"
    hundred billionth 10-11 0.00000000001. "ten to the minus eleven"
    trillionth 10-12 0.000000000001 "ten to the minus twelve"
    ten trillionth 10-13 0.0000000000001. "ten to the minus thirteen"
    hundred trillionth 10-14 0.00000000000001. "ten to the minus fourteen"
    and put that field label indicating the 10th power. Like "Accuracy in 10 POW -9"
    Just a wild guess.well thats how we usually show data in catalogues too!
    (or)
    separate the integer and decimal portions into two fields and store it in the repository.(split on ',')
    -Sudhir.

  • When will Siri know how to look up places in Hong Kong?

    Hi,
    I am located in Hong Kong and Siri does not know how to find restaurants/places in Hong Kong. Does anybody know when/if Siri might know Hong Kong?
    Thanks

    This is all we know:
    http://www.apple.com/iphone/features/siri-faq.html
    Regards.

Maybe you are looking for

  • Problem with image size, please help!

    I have spent the last week editing several photos I took for my cousin of his newborn baby (removing backgrounds/people, editing colours etc etc). I went to get them printed but the image size is only around 800 x 400 pixles. I checked my original im

  • Application Logging in a cluster

              I have an application that logs to a file.           However, this presents a problem when the application runs in a clustered environment.           In that case, two files are written to, which is bad.           Any suggestions would be a

  • Motherboard issue w/K9A Platinum MS-7280

    I been having problems with this Motherboard due to installing external USB devices in it and then within seconds/minutes if freezes the machine so i would have to reboot.  Anyone else having this issue? I have a updates on the machine and looked int

  • Deposit review(DEPRVW) batch is not picking Deposit recommendation algo

    I have created deposit recommendation algo as per customer requirement and attached the algo at Deposit class, but after running the DEPRVW batch it is not picking the algorithm. In thredpool.log files it is showing the list of all attached algo at d

  • Maximum number of sessions in the portal

    Hi, Please, do you know the maximum number of sessions that a particular user can open in the portal 7 ? and it´s posible to limit the number of sessions of a user thanks in advance.