Quantcast

ShortQty is declared as double

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ShortQty is declared as double

Anila Saifan
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/



Hi Team,

I am currently facing some errors when tried to send a message below:
Message.setfield(705,new ShortQty(doublevalue));

The ShortQty value I read from a CSV file is 17508780 .

When I try to use the above value I need to parse it to double.
double doublevalue=Double.parsedouble("17508780");

When I try to send the above message I get a reject from server saying ShortQty value 1.75087E6 is incorrect expecting a float.

So its sending the ShortQty value with scientific notation to the server which is expecting 17508780 .

Could you please help me with the above issue.I could see the ShortQty function is taking a double value.Why has the ShortQty function is taking double value .Can you please advise?

Appreciate your help in this.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ShortQty is declared as double

Robert Engels-2
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/



The real problem is that the encoded of the double is incorrect. I don't think it should every be in scientific notation with FIX.

On Thu, Apr 27, 2017 at 10:55 AM, Anila Saifan <[hidden email]> wrote:
QuickFIX/J Documentation: <a href="http://www.quickfixj.org/documentation/ QuickFIX/J" rel="noreferrer" target="_blank">http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/



Hi Team,

I am currently facing some errors when tried to send a message below:
Message.setfield(705,new ShortQty(doublevalue));

The ShortQty value I read from a CSV file is 17508780 .

When I try to use the above value I need to parse it to double.
double doublevalue=Double.parsedouble("17508780");

When I try to send the above message I get a reject from server saying ShortQty value 1.75087E6 is incorrect expecting a float.

So its sending the ShortQty value with scientific notation to the server which is expecting 17508780 .

Could you please help me with the above issue.I could see the ShortQty function is taking a double value.Why has the ShortQty function is taking double value .Can you please advise?

Appreciate your help in this.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users




--

Robert Engels

 

OptionsCity Software
150 S. Wacker Dr., Suite 2300
Chicago, IL 60606

O. +1 (312) 605-4500 | F. +1 (312) 635-1751 

 

Connect with OptionsCity at www.optionscity.com  | LinkedIn  |  Twitter  |  YouTube  |  Facebook

 

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ShortQty is declared as double

Christoph John
In reply to this post by Anila Saifan
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


Hi,

I'd try to either set the field directly as String, e.g. Message.setString(705, "1234") or use
DoubleConverter.convert("1234"). This will also check if the passed String contains a double that is
FIX conformant.

Regards,
Chris.


On 27/04/17 17:55, Anila Saifan wrote:

> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
>
>
>
>
> Hi Team,
>
> I am currently facing some errors when tried to send a message below:
> Message.setfield(705,new ShortQty(doublevalue));
>
> The ShortQty value I read from a CSV file is 17508780 .
>
> When I try to use the above value I need to parse it to double.
> double doublevalue=Double.parsedouble("17508780");
>
> When I try to send the above message I get a reject from server saying ShortQty value 1.75087E6 is
> incorrect expecting a float.
>
> So its sending the ShortQty value with scientific notation to the server which is expecting 17508780 .
>
> Could you please help me with the above issue.I could see the ShortQty function is taking a double
> value.Why has the ShortQty function is taking double value .Can you please advise?
>
> Appreciate your help in this.
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
>
> _______________________________________________
> Quickfixj-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quickfixj-users

--
Christoph John
Development & Support
Direct: +49 241 557080-28
Mailto:[hidden email]
       


http://www.macd.com <http://www.macd.com/>
----------------------------------------------------------------------------------------------------
       
----------------------------------------------------------------------------------------------------
MACD GmbH
Oppenhoffallee 103
D-52066 Aachen
Tel: +49 241 557080-0 | Fax: +49 241 557080-10
         Amtsgericht Aachen: HRB 8151
Ust.-Id: DE 813021663

Geschäftsführer: George Macdonald
----------------------------------------------------------------------------------------------------
       
----------------------------------------------------------------------------------------------------

take care of the environment - print only if necessary

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Loading...