BigDecimal division

HI All,
I want to use the Bigdecimal logic for dividing the by 100 in message Mapping.
How can i achive this..Is there any documentation is available? or anybody can tell me how can i use bigdecimal for  division?
REgards
Venkatesh

Convert the string to BigDecimal and use division available for BigDecimal and then convert the result to String if needed
this is simple and can be easily done using BigDecimal Class use API for the same
http://java.sun.com/j2se/1.4.2/docs/api/java/math/BigDecimal.html
Rajesh

Similar Messages

  • BigDecimal, division method and Rounding

    I want guys to check out my observation of the BigDecimal and comment on which is really the best way of working around with the class instead of using double or float. The particular emphasis is on BigDecimal division method.
    I posted a test class to drive my point
    import java.math.BigDecimal;
    import java.math.MathContext;
    * @author m-enudi
    public class BigDecimalDivideTest {
        public static void main(String[] args) {
            BigDecimal first = new BigDecimal(10f);
            BigDecimal second = new BigDecimal(1000f);
            BigDecimal result1 = first.divide(second, BigDecimal.ROUND_CEILING);
            BigDecimal result2 = first.divide(second, BigDecimal.ROUND_DOWN);
            BigDecimal result3 = first.divide(second, BigDecimal.ROUND_FLOOR);
            BigDecimal result4 = first.divide(second, BigDecimal.ROUND_HALF_DOWN);
            BigDecimal result5 = first.divide(second, BigDecimal.ROUND_HALF_EVEN);
            BigDecimal result6 = first.divide(second, BigDecimal.ROUND_HALF_UP);
            BigDecimal result7 = first.divide(second, BigDecimal.ROUND_UP);
            BigDecimal result8 = new BigDecimal(first.doubleValue() / second.doubleValue());
            BigDecimal result9 = first.divide(second, MathContext.DECIMAL128);
            System.out.println(" >>>>>>>>>>>>>>>>>>>>>>> " + result1);
            System.out.println(" >>>>>>>>>>>>>>>>>>>>>>> " + result2);
            System.out.println(" >>>>>>>>>>>>>>>>>>>>>>> " + result3);
            System.out.println(" >>>>>>>>>>>>>>>>>>>>>>> " + result4);
            System.out.println(" >>>>>>>>>>>>>>>>>>>>>>> " + result5);
            System.out.println(" >>>>>>>>>>>>>>>>>>>>>>> " + result6);
            System.out.println(" >>>>>>>>>>>>>>>>>>>>>>> " + result7);
            System.out.println(" >>>>>>>>>>>>>>>>>>>>>>> " + result8);
            System.out.println(" >>>>>>>>>>>>>>>>>>>>>>> " + result9);
            System.out.println(" >>>>>>>>>>>>>>>>>>>>>>> " + (first.doubleValue() / second.doubleValue()));
    }Try working with test samples like
    first = 129.0494
    second = 39484.111
    I did not try to use the BigDecimal.ROUND_UNNECCESSARY because it always caused the ArithmeticException.
    can you guys comment on the best way of doing division with the BigDecimal class.
    For now I seem comfortable with using the MathContext approach, though not in anyway an authority in the use of the class.
    Regards

    This result changed significantly with a change in code as listed below:
            BigDecimal result1 = first.divide(second, 2, BigDecimal.ROUND_CEILING);
            BigDecimal result2 = first.divide(second, 2,  BigDecimal.ROUND_DOWN);
            BigDecimal result3 = first.divide(second, BigDecimal.ROUND_FLOOR);
            BigDecimal result4 = first.divide(second, BigDecimal.ROUND_HALF_DOWN);
            BigDecimal result5 = first.divide(second, 2,  BigDecimal.ROUND_HALF_EVEN);
            BigDecimal result6 = first.divide(second, 2,  BigDecimal.ROUND_HALF_UP);
            BigDecimal result7 = first.divide(second, 2,  BigDecimal.ROUND_UP);
            BigDecimal result8 = new BigDecimal(first.doubleValue() / second.doubleValue());
            BigDecimal result9 = first.divide(second, MathContext.DECIMAL128);

  • Large numbers without BigInteger or BigDecimal

    I need to write a program that handles basic math operations on large ( 32k+ ) digit integers. I can't make use of the BigInteger or BigDecimal classes. Does anyone have any suggestions on where to start? I'm still relatively new to java programming, so when I tried to read through BigInteger to get an idea of how it's done, my head nearly exploded.
    I figured the easiest way to do it would be to convert the arguments to a string of binary, and go from there, but its circular logic, since I'd need to divide a number too big to do division on in order to convert to binary.
    Any help is much appreciated.

    JamesEarlLMU said:
    I need to write a program that handles basic math
    operations on large ( 32k+ ) digit integers. I can't
    make use of the BigInteger or BigDecimal classes.
    Does anyone have any suggestions on where to start?
    I'm still relatively new to java programming, so when
    I tried to read through BigInteger to get an idea of
    how it's done, my head nearly exploded.I guess this is a school assignment? Seems a little weird. It isn't exactly trivial, is it?
    Is it for a maths class or just a basic java class? If it's a math class, then I guess you're stuck trying to figure out the way BigInterger does it, and replicating it, but if it's a basic programming class then it seems like a really dumb assignment.
    If it's not even for assignments and possibly cause you are using a reduced JDK, then I'd try and find a 3rd party lib that will give you these features; I'm sure there are some around.
    -- watercolour...yes?

  • Simple division in Java

    Hi all,
    Can someone explain the following to me
    int num1 = 110/60 - answer = 1 (expected)
    float num2 =110/60 - answer also =1 ( not expected)
    How do I get accurate results for my division?
    Thanks

    JoachimSauer wrote:
    Saish wrote:
    Or if you want exact precision, use java.math.BigDecimal.How well does it represent 1/3?
    I just want to show that "exact precision" without a detailed explanation what it actually means can't really be achieved in a general case.
    You can only get:
    1.) more digits
    2.) a closer match to a other (faulty) system that is better-known and thus "looks" more precise (i.e. BigDecimal)
    3.) exact representation for a subset of all values.An exact representation given a precision of n. I am sure it will be impossible to represent transcendental numbers as well. :^)
    - Saish

  • BigDecimal scale, rounding and ArithmeticException

    Can anyone refer me to a good article or site where the appropriate use of the BigDecimal Class is shown. I keep having a lot of ArithmeticException especially when doing division or setting scale. It is becoming frustrating that I refer to doing calculation with double and changing them back to BigDecimals.
    Thanks in advance
    Michael

    okmich wrote:
    thanks for the reply,
    but my most confusing part of the use of MathContext object.
    the rounding up constants are also easy to use, but the java doc does not really explain the vital importants of the MathContext class.
    I would appreciate if you can throw light on the class MathContext.
    Regards,
    MichaelSome light on MathContext: The int you specify when you make it is the number of decimal places it will use at a maximum. By default I'm pretty sure it rounds half up. You can apply it to an operation like BigDecimal.divide(BigDecimal, MathContext); It should work for stuff like subtract and multiply in the same way.

  • Floats using BigDecimal

    I am trying to float my answer using BigDecimal, anyone have any suggestions? PLease Help.
    import java.lang.reflect.*;
    import java.awt.*;
    import java.io.*;
    import java.math.*;
    class myMean
              public float myMean(float x)     
                   float result = 0;     
                   result = (x += result);
                   return (result);     
    class MethodCalls
         public static void main(String[] args) throws IOException
              // declarations
              BufferedReader in = new BufferedReader (new InputStreamReader(System.in));
              myMean out = new myMean();     
              String sArraySize, strgrade, strdecimal;                    
              double size =2;
              float score = 0, tracker = 0;      
              float FloatConversion;
              float callAverageMethod;
              int x= 0;
              System.out.println("Please enter the number of tests to average:");
              sArraySize = in.readLine();           
              size = Double.parseDouble(sArraySize);      
              System.out.println("Please enter the amount of decial places to use:");
              strdecimal = in.readLine();
              x = Integer.parseInt(strdecimal);
              for (float counter=0; counter < size; counter++)     
                   // input on the test scores come here          
                   System.out.print("What is the score of the " + (counter+1) + " test: ");
                   strgrade = in.readLine();
                   score = Float.parseFloat(strgrade);
                   tracker += score ;          
              callAverageMethod = out.myMean(tracker);
              System.out.println();      
              BigDecimal bd = new BigDecimal(callAverageMethod);
    bd = bd.setScale(x, BigDecimal.ROUND_UP);
              System.out.println(" The average score of the " + size + " tests is: " + bd/size);
    }

    Try doing the computation ( sum / num grades ) within the BigDecimal. If you create the BigDecimal and then do the integer division, you'll create a new double that isn't subject to the rounding.
    public class bdtest {
        public bdtest() {
        public static void main(String[] args) {
            float f = 100.0f;
            int n = 6;
            BigDecimal bd = new BigDecimal( f / n );
            bd = bd.setScale( 2, BigDecimal.ROUND_UP );
            System.out.println( bd );
    }

  • Computing an appropriate division scale for pow with negative arguments?

      private static BigDecimal pow(BigDecimal bd, int n) {
        return n < 0 ? BigDecimal.ONE.divide(bd.pow(-n), _ARBITRARY_NUMBER_ , BigDecimal.ROUND_HALF_UP) : bd.pow(n);
      }Rather than plugging in an arbitrarily large number for the scale in the division operation, I would like to try to set the value appropriately. I tried simple formula that basically mulitiplied bd * n / 10, which worked nicely for some values, but gave overly large values for others.
    Based on the data that I expect to process I think I could set it to 3000, but I would prefer not to take the risk, and it's just plain stupid to make all calls to the function pay the penalty.
    Is there a algorithm that could approximate the value of what the final answer will be so I can plug an appropriate value into the scale?

    Is there a algorithm that could approximate the value of what the final answer will be so I can
    plug an appropriate value into the scale? You don't need a scale for the pow operation, so first do BigDecimal recip = bd.pow(-n)Now the final answer is 1 / recip, so the scale is roughly -log10(recip). Google BigDecimal logarithm and you'll find a few open source libraries which can do that stage. (In fact IIRC you'll find a library which does arbitrary powers of BigDecimals).

  • Sale Order without Division

    Hi,
    I have an issue in prodution system, there is a sales order created in 2008 without division (I dont know how the system allowed), this sale order is created with reference to a contract, and the contrct is having division. And now users want to close the sale order. When i am trying to open sale order in VA02 / VA03, it is giving error mesage " Sales area 1000 10 is not defined". Now I am unable to open the order.
    Pls anybody suggest me how to close this order??
    How system will allow to create a sale order without delivery??
    Regards,
    Srikanth

    Hi,
    I can see a way by which this could have happened.
    Initially there was a sales area called 1000/10/00. For tihs sales area, some transactions were created. After sometime, by mistake or intentionally the assignment of this sales area is deleted in configuration. If this is done, it will affect the documents in retrospect and all those documents cannot be processed from then onwards. There is a possibility that this has happened in your case.
    Check some other sales orders for the sales org 1000 created in 2008 and you are bound to get this error. If you realise that there are lot of documents affected because of this, please check the change logs in the sales area configuration and find out when was the sales area dimantled in the system. There can be some business reason behind this. Find out the business reason, tell them implication of removing the sales area, do the configuration once again and rectify the affected documents once again by means of a Zprogram.
    Please check initially what is said, and let me know if you need more information on this

  • Unable to enter a Division for which I have proper credentials, via the GUI

    I have a Division which I am unable to enter, either as a student or as the full site Administrator, from the GUI.
    When I log into the main Site page, I see the link for the Division (as I should - I have DOWNLOAD permissions for the Division). However when I click the link (the thumbnail image) I am always, 100% of the time, rejected and sent to the login page. Ignoring that, I still have all of my proper credentials and may continue to freely access other parts of the site.
    In the past, I had this exact behavior on (1) a Division "RobotCourses:PSYC" (Psychology), and (2) my main site breadcrumb, which appears at the top of the site page to the right of the "iTunes U" breadcrumb and says "Maiko Covington @ University of Illinois..." For reasons completely unknown to me, this behavior resolved itself yesterday, clicking both of those objects works as expected, although NO one at our site with any edit access did anything on the server.
    However, the same behavior has now reappeared, this time on a Division "RobotCourses:CLCV" (Classical Civilizations). Again, I have not done any editing of that Division, nor had anyone logged into it (these Divisions are in a test area where I am developing automation tools).
    I am, quite frankly, stumped. But I've done some investigation.
    SETUP:
    The Division has identity "RobotCourses:CLCV".
    This Division contains a single Course with identity "RobotCourses:CLCV:CLCV115:CLCV115All-13564".
    Both the Division and the Course are restricted to properly registered academic students. I have developed automation code in a login portal which grants credentials for RobotCourses:CLCV to students registered for courses in the CLCV department (Classical Civilizations) and credentials for RobotCourses:CLCV:CLCV115:CLCV115All-13564 to students registered for CLCV 115 (Classical Civilizations 115 - Mythology of Greece and Rome) specifically.
    The Permissions set on RobotCourses:CLCV in particular are:
    <Permission>
    <Credential>Authenticated@urn:mace:itunesu.com:sites:illinois.edu</Credential>
    <Access>No Access</Access>
    </Permission>
    <Permission>
    <Credential>gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV</C redential>
    <Access>Download</Access>
    </Permission>
    The point is to deny access to Authenticated@ (merely authenticated students) and then specifically grant it for people given a "gakusei" credential for RobotCourses:CLCV in particular.
    (Note here that "gakusei" is a Japanese word meaning "student," I am using it in my credentials to ensure that my credentials and permissions are not affected by other credentials named "student" set at upper levels and used by some live users of the site, as we do not have a segregated development environment. It is our lowest level of access beyond mere Authenticated@..., designed to give students access to download and "surf to" Divisions and Courses.)
    *LOGIN: ISSUING CREDENTIALS:*
    The login portal code works successfully, and so when a student "Jane Doe" logs in, she is in fact given appropriate credentials (as she is actually registered for CLCV 115 here at UIUC). From the code generating her login URL, I see:
    Issued credentials:
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV:CLCV115:CLCV1 15All-13564
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT:STAT100:STAT1 00X1-13570
    (You can see she is also registered for STAT 100).
    With the default login URL thus generated, she is taken to the top level of the Site in iTunes, and in fact sees thumbnail links for both STAT (Statistics) and CLCV (Classical Civilizations). Clicking on STAT takes her to the STAT Division where she can then enter the Course STAT 100 with no problems.
    *PROBLEM: CAN'T GET TO CLCV FROM THE MAIN PAGE IN THE GUI*
    HOWEVER! Clicking on CLCV brings up the login page. If she ignores the login page, she can still access the rest of the site, including STAT, just fine. Logging in again (reissuing her credentials) does not help the situation.
    Note that this is not a problem only for Jane Doe, the same thing happens for anyone in CLCV and in fact happens for me as Administrator of the whole site with full access, even.
    *ACCESS DIRECTLY TO THE DIVISION BY URL WORKS*
    With a slight modification to the login to allow access directly to the RobotCourses:CLCV Division (by adding the handle of the Division to the end of the location), credentials are issued exactly as before:
    Issued credentials:
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV:CLCV115:CLCV1 15All-13564
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT:STAT100:STAT1 00X1-13570
    and she is taken to the Division page, SUCCESSFULLY. So, it seems she actually HAS access, as expected.
    *ACCESS CONFIRMED WITH DEBUGGING:*
    Writing some code to generate not the actual login URL but rather a link that takes me to an "iTunes U Access Debugging" page for the Division (figured this out by reading some other posts! :)) I am taken to a page with the following:
    (at generated URL https://deimos.apple.com/WebObjects/Core.woa/Browse/illinois.edu.1945806043/xxx5 64?credentials=....)
    Received
    Destination illinois.edu.1945806043
    Identity "Jane X Doe" <[email protected]> (jxdoe) [xxxxxxxxx]
    Credentials gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV; ​ gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV:CLCV115:CLCV1 15All-13564; ​gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT;​ gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT:STAT100:STAT1 00X1-13570
    Time 1236877947
    Signature 42ccef92a3298684a7a09eed45adb6b788a700c01645b8b423d33ace120650b0
    Analysis
    The destination string is valid and the corresponding destination item was found.
    The identity string is valid and provides the following information:
    Display Name Jane X Doe
    Email Address [email protected]
    Username jxdoe
    User Identifier xxxxxxxxx
    The credential string is valid and contains the following 4 recognized credentials:
    1. gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV
    2. gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV:CLCV115:CLCV1 15All-13564
    3. gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT
    4. gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT:STAT100:STAT1 00X1-13570
    The time string is valid and corresponds to 2009-03-12 17:12:27Z.
    The signature string is valid.
    Access
    Because the received signature and time were valid, the received identity and credentials were accepted by iTunes U.
    In addition, the following 2 credentials were automatically added by iTunes U:
    1. All@urn:mace:itunesu.com:sites:illinois.edu
    2. Authenticated@urn:mace:itunesu.com:sites:illinois.edu
    With these credentials, you have browsing and downloading access to the requested destination.
    (In case you think to check the sums, be aware I've actually changed the student's name for this example.)
    So, as expected, I have access, in fact the student DOES have access, visiting the Division page directly (specifiying its handle as part of the desired location).
    *IT'S ONLY CLICKING THE THUMBNAIL ON THE MAIN PAGE THAT BREAKS*
    Because the problem is only apparent when clicking the icon for the Division on the main Site page, I have no way (that I know of) to get any information about precisely WHAT is going on, what possibly differs in the GUI-click situation from the "generate me a URL that takes me right there" situation.
    At that point I'm fully in the GUI, I'm not sending anything via web services, so I have no idea how I can proceed to debug this from here.
    I'm also quite confused at the sudden appearance of this behavior, and the disappearance of this behavior from RobotCourses:PYSC, another Division that was broken in this same way all last week but which magically resumed allowing me access yesterday.
    Any suggestions, hints, or advice would be very welcome. Has anyone else even seen behavior similar to this?
    Thanks for any information you might have.

    Maiko,
    I'm confess I'm still trying to get a handle on your problem. You do a fantastic job of describing it ... but I'm just trying to picture it accurately in my head.
    I think, were I in your shoes, I'd begin by looking at what the debug page has to say for the specific destination in which you're interested in fixing. In other words, I'm not clear on where, exactly, this destination points ...
    Destination illinois.edu.1945806043
    Is that your site, or the division within your site that you want to fix? "Normally", you do not need to specify a site handle to get to your site within your transfer CGI ... if you say "uillinois.edu", it's enough to transfer your users to iTunes U ... but every site still has a handle, and you could, if you wanted to, actually specify it in your transfer CGI. For example, this:
    Destination uic.edu.1139051993
    is for my entire site ... it's my site handle. Whereas this:
    Destination uic.edu.1991288441
    is for a division within my site ... but it's impossible to tell the difference between "site" and "division" from just the handle (I mean, if I didn't say "this is a site" and "this is a division", there'd be no way for you to know). So when I look at your creds and permissions on your debug page, I can't quite tell if they give you download access for your site, or for the specific division you want to fix. If you could open the debug page with your division as destination (or confirm that that's what we're looking at), it'd rule out some things.

  • Free Goods of different division

    Dear Gurus,
    our sales department announced following sales promotion policy i.e. Buy one LCD (Division 60) and get one cemra (DIvision 30) free
    we have successfully configured SAPSD free goods scenario, but at the same time we process one order for one division only. please note that for control purpose we have made our each product as division and same as credit control area
    now as mentioned above free good division deviates from main item division, how can we cater both in one sale order.  please note that in VOV8 we have maintained check division indicator 2(Error) and can not convert it in o or 1
    please tell me how can we implement sales policy in SAP
    BR
    Sajida

    Hi,,
    please note that in VOV8 we have maintained check division indicator 2(Error) and can not convert it in o or 1
    Even you removed 2 from document type then it will no impact on material division as it is only check purpose for more divisions can not be included in one document.
    If you don't want to remove then system will not process material from more than 1 division.
    kapil

  • Free Goods for Materials from the same division

    Hi Friends,
    We are trying to configure free goods based on customer and division in our system. If a customer orders any material belonging to a specific division, he is entitled for a free good.
    For this we created a new condition table based on customer and division and maintained condition records that if he orders 100 qty of any material in Division 10 that he is entitled for 1 qty of material X.
    Now the problem is that at the time of creating the sales order if Material A is entered for qty 50 and Material B is for qty 50 then the system does not give free goods. However, if we enter Materail A for 100 qty it gives the free goods 1 qty of Material X. Similarly, for Mat B with 100 qty it gives Mat X as free goods.
    The system is not adding up the quantities for the multiple line items to calculate the free goods.
    Is there any way by which we can achieve this.
    Regards,
    Abhishek

    Hi,
    So far me too have configured and getting free goods for one material. for your requirement, i think you have to tell your Abaper to do corresponding Enhancement.
    Thanks
    Ashok

  • Problem in creation of divisions.what is the necessity of multi ple divisio

    hi in my organization we are manufacturing some plastic products  for vehichle parts
    but some are for doors some are for arm rest and some are for roof
    annother way we are also doing garnishing jobs for some company
    and for some rail company we are making bath room doors so
    my queastin arrises here
    how many divisions i ve to creat as my products are Build to Order ans some are locally sold as per order and some are export to outside so how many divisions i ve to creat and
    if multiple divisions are there why the need of multiple division
    can anybody give me the exact definition of DIVISION
    regards
    subrat
    [email protected]

    Can amyone give me the solution to my email address [email protected]
    Our client needs a high level SAP SD resource ON SITE to do a feasibility and estimation project. Basically they need to come in and determine how long the actual project will take. Below is their issue:
    Per the client:
    "When entering a sales order, there are 3 attributes that need to be assigned. The attribute in question is the "Division" attribute. We want to merge the multiple division attributes into one for future sales orders. Currently the division attribute is assigned separately, for example, "ABC" line products and "XYZ" line products are assigned a different division attribute. We want to combine this attribute into one "123" line. Apparently, this change has a domino effect on multiple other areas that also need to be changed to maintain the systems integrity."
    They are looking for a person to evaluate this project and estimate the number of people hours and what types of people (expertise), to make all the necessary changes for this to be a successful project. The deliverable would be a project break down regarding what steps need to be taken, what resources will be needed, and ultimately how long the project would take.

  • I can not see all "Divisions" in BP Rel.--Partner Function Assignment

    Hi,
    When I edit "Partner Function Assignment" in BP reliationship such like BUR011("Employee Responsible"),
    I can not see all "Divisions" in list which I can see in configuration via SPRO-->Customer Relationship Management->Master Data->Orgnizational Management->Division Setting->Define Divisions.
    E.g., in configuration, I can see 7 records of divisions from "001" to "007", but in "Partner Function Assignment" of BP relationship, I can only see "002" to "004".
    Do you know why? Thanks a lot!
    Best regards,
    Long

    hi
    that should not be happening,if they are visible in one client then should be there in another too
    do one things try run  this
    hrbc1_atributes_buffer_update
    it will refresh the buffers of your org structure and then you may be able to add this
    also check the check box where it is mentioned that"object determination should be permitted"
    remember it will run only for once after you run this the check box will be unchecked again
    i guess it may solve your probs
    also try to structure your org structure index
    use t code
    crmd_index_om
    and withtin the object type give O
    and execute
    best regards
    ashish

  • Need help with 'division' operation in RTF template

    We are using variables in RTF template to perform all data manipulations
    To calculate columns where we need to do division operation, using ‘/’ or ‘DIV’ is not working.
    Using <?xdofx: op1 DIV op2?> is working only when op1 and op2 are numbers like ex. <?xdofx: 100 DIV 50?> returns result 2.
    But the same tag used for columns or variables is not working.
    For ex.
    <?xdofx: (xdoxslt:get_variable($_XDOCTX, 'var1')) DIV xdoxslt:get_variable($_XDOCTX, 'var2') ?> is not returning any result, though
    <?xdoxslt:get_variable($_XDOCTX, ‘var1’)?>
    <?xdoxslt:get_variable($_XDOCTX, ‘var2’)?>
    both are returning values stand alone.

    On Thu, 03 Jan 2008 00:22:31 -0500, Alan
    <[email protected]> wrote:
    >yes, the use of child page comments in a template file is
    probably the
    >problem. But if that is solved, having two editable
    regions with the same
    >name will cause problems.
    >
    >short version- things be horked big time.
    <chuckle /> Methinks you're right. It looks like the
    copy/paste monster
    has been munching on it. One guess to fix it would be to open
    it in a
    text editor and change this:
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <!-- InstanceBeginEditable name="head" -->
    To this:
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    And change this:
    <!-- InstanceEndEditable --></head>
    To this:
    </head>
    Gary

  • Problem with Long and BigDecimal DataType convertion

    HI,
    I have an application which talk to MySQL database with Spring JDBC layer and everything runs like a champ :)
    Now I am converting the same application with the same DAO implementation to communicate with oracle database and I am having some trouble converting DataType from database to my java code.
    For example before with MySQL I would convert any Integer coming from the database to Long datatype and it worked. Now it seems that Int datatype from oracle comes as a BigDecimal type.
    I am thinking about two approaches writing an additional implementation to implement my dao interfaces or if there is some trickery that I can bypass doing that and work around these datatype incompatibility from MYSQL to Oracle.
    I can also put bunch of try and catch statements and if fails with Long try with BigDecimal, but still don't buy it as the best solution.
    Here use also code snippet:
    User u = new User();
                        u.setObjectId((Long) m.get("oid"));//This works with MYSQL backend but not with Oracle so the raw object seem to be coming as BigDecimal datatype
                        u.setLogon((String) m.get("logon"));
                        u.setPassword((String) m.get("password"));
                        u.setName((String) m.get("uname"));
                        u.setCompany(companyDAO.getById((Long) m.get("cOid")));Any help will be appreciated.
    Edited by: kminev on Mar 3, 2010 12:25 PM

    //This is my entity class
    public class User implements Comparable<User>  {
        private Long objectId = 0L;
        private Company company;
        private String logon = "";
        private String password = "";
        private String name = "";
        private boolean hasAdminRights=false;
        private boolean hasMaintenanceRights=false;
    //This is my bean class
    <bean id="userDAO" class=" com.myorg.myapp.dao.jdbc.UserImpl">
            <property name="transactionManager">
                <ref local="transactionManager"/>
            </property>
            <property name="companyDAO">
                <ref local="companyDAO"/>
            </property>
            <property name="companyAccessDAO">
                <ref local="companyAccessDAO"/>
            </property>
        </bean>

Maybe you are looking for