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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
Expand all | Collapse all

Getting the String representation of a Double variable

  • 1.  Getting the String representation of a Double variable

    Posted 11/22/02 01:53 AM

    I have this variable called ‘Amount’, which is of type double. This goes in as an input to a JDE Business Function (which takes only String values). When the ‘Amount’ variable has a value like ‘345678.76’, this goes in perfectly into JDE. In case of a larger amount, the Double variable implicitly converts it to an exponential format (‘4.52E7’). When this value is passed onto JDE Business function, it throws a numberFormatException.

    Is there any way I can get a String representation of teh Double 4.52E7 (i.e. ‘45200000’), so that it goes into JDE smoothly?


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


  • 2.  RE: Getting the String representation of a Double variable

    Posted 11/22/02 03:41 AM

    You can use java.math.BigDecimal to do the conversion work for you. The specifics of how to instantiate a BigDecimal object and use it will depend on what webMethods tool set you’re using.

    You should strongly consider changing the data type of ‘Amount’ from double to string. There is an eZine article ([url=“wmusers.com”]wmusers.com) that describes the issues using float and double and possible solutions.


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