| Author | 
		  Message
		 | 
		
		  | Svp | 
		  
		    
			  
				 Posted: Mon Mar 08, 2010 8:17 pm    Post subject: Exponential Problem in Float data type | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 18 Feb 2010 Posts: 40
  
  | 
		  
		    
			  
				I have a web service message flow which stores the message in a queue and reply to the requestor
 
SOAP I/p --- Compute --- MQ O/p-- soap reply.
 
 
I send a SOAP message in which one of the element <Price> has float as data type.
 
<Price>2.33</Price>.
 
When I check the message in the Queue it has the value <Price>2.33E0</Price>
 
 
can anybody help me to get rid off the Exponent E0 before I store it to Queue.
 
 
When I debug the flow I can see the value 2.33 until it reach MQ o/p node. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Mon Mar 08, 2010 8:22 pm    Post subject: Re: Exponential Problem in Float data type | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| Svp wrote: | 
   
  
	| can anybody help me to get rid off the Exponent E0 before I store it to Queue. | 
   
 
 
 
Why? It's the same number and the proper representation of a float. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Svp | 
		  
		    
			  
				 Posted: Mon Mar 08, 2010 8:56 pm    Post subject: It's the same number and the proper representation of a floa | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 18 Feb 2010 Posts: 40
  
  | 
		  
		    
			  
				Yes, you are right Victor.
 
The message stored in the Queue, I have to send it to the other vendors.
 
They dont need the Exponent value.
 
Is there any chance to store just the 2.33 instead 2.33E0? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Mon Mar 08, 2010 9:10 pm    Post subject: Re: It's the same number and the proper representation of a  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| Svp wrote: | 
   
  
	| Yes, you are right Victor. | 
   
 
 
 
Why does everyone call me that?    
 
 
   
	| Svp wrote: | 
   
  
	I have to send it to the other vendors.
 
They dont need the Exponent value. | 
   
 
 
 
That's a shame if the XML Schema behind the SOAP message describes this as a float. A float has an exponent.
 
 
   
	| Svp wrote: | 
   
  
	| Is there any chance to store just the 2.33 instead 2.33E0? | 
   
 
 
 
Not without changing the datatype, which requires changing the SOAP message. Which will annoy all the other vendors who should be expecting a float if they're using the same schema as you. 
 
 
So someone's wrong. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Svp | 
		  
		    
			  
				 Posted: Mon Mar 08, 2010 9:25 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 18 Feb 2010 Posts: 40
  
  | 
		  
		    
			  
				| Thanks, I will talk with the right people and find a solution. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | AndreasMartens | 
		  
		    
			  
				 Posted: Wed Mar 10, 2010 3:38 am    Post subject: CAST with FORMAT | 
				     | 
			   
			 
		   | 
		
		
		    Acolyte
 
 Joined: 30 Jan 2006 Posts: 65 Location: Hursley, UK 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Wed Mar 10, 2010 5:59 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				While that correctly formats the number, would it still match a float datatype? You could achieve the same end by using decimal instead of float and controling precision. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | AndreasMartens | 
		  
		    
			  
				 Posted: Wed Mar 10, 2010 6:08 am    Post subject: xsd:float | 
				     | 
			   
			 
		   | 
		
		
		    Acolyte
 
 Joined: 30 Jan 2006 Posts: 65 Location: Hursley, UK 
  | 
		  
		    
			  
				| I didn't realise at first that the xml datatype was float, but yes xsd:float has an optional exponent. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |