IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Decimal places when using pubmathdivideInts

  • 1.  Decimal places when using pubmathdivideInts

    Posted Thu April 17, 2003 01:46 PM

    This may be a ridiculous question but I am new to webMethods and trying to divide two number using the pub.math:divideInts service
    num1 = 925.00
    num2 - 384.00

    The value being returned is 2. This is going to be a dollar amount so I would like to take it out to two decimal places. I would expect the result to be 2.41.

    Does anybody have any ideas how I can format the output so that the output value is the 2.41?

    Thanks in advance!


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 2.  RE: Decimal places when using pubmathdivideInts

    Posted Thu April 17, 2003 03:06 PM

    Write a Java service to use the BigDecimal class for this operation. Do not use pub.math:divideFloats–you’ll run into accuracy errors. See the Ezine article at [url=“wmusers.com”]wmusers.com


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services