Re: [Quickfix-developers] Incoming bad price fields
Brought to you by:
orenmnero
From: Oren M. <or...@qu...> - 2004-04-26 15:48:23
|
John and Patrick, You can have the field treated like a string by opening up your data=20 dictionary file and changing the type of those fields to STRING. This=20= will circumvent any validation but you will then need to do the=20 conversion from a string to a double yourself. Really, though, QuickFIX should be able to handle this value. The fact=20= that it cannot is actually a bug. I wrote a unit test and verified=20 that QuickFIX will not correctly validate a double if it has extra=20 trailing zeros. A weird thing to do, but doesn't break the definition=20= of a valid floating point in FIX. I'll work on a fix for this and post=20= it to the mailing list. In the meantime the STRING trick should work=20 for you. --oren On Apr 26, 2004, at 8:31 AM, John Debay wrote: > Hi, > > I am receiving a double as a string value from a server application=20 > over > which I have no control. They are not handling floating point numbers > correctly (they are using native doubles), so I am getting values with > rounding errors in them within the message. When this value is then=20 > received > by QuickFix, it rejects the message because it can't parse the field > correctly (the message is an execution report). I am still wading=20 > through > the QuickFix code to find out where the rejection takes place, but in=20= > the > interim I was wondering if there is a way to get around this problem=20= > without > changing the code. Is there something I can set in my message=20 > definition > file or something like that to get it to either accept a funky double=20= > value, > or to treat the double as a string and let me parse it? Is there a = hook > somewhere (like fromApp with a non-const Message) where I can fix the=20= > value > on the way in before QuickFix tries to build a typed message for it? > > For example, I am receiving a message of type 8, and am receiving a=20 > LastPx > and AvgPx value of 250.300000000000010, which QuickFix is rejecting. > > I'm using QuickFix 4.2. > > Thanks, > John > > ----------------------------------------------------------- > This email message is intended only for the addressee(s) > and contains information that may be confidential and/or > copyright. If you are not the intended recipient please > notify the sender by reply email and immediately delete > this email. Use, disclosure or reproduction of this email > by anyone other than the intended recipient(s) is strictly > prohibited. No representation is made that this email or > any attachments are free of viruses. Virus scanning is > recommended and is the responsibility of the recipient. > > Thank you. > ----------------------------------------------------------- > > For more information on CTC, LLC please visit > our website at: > > http://www.chicagotrading.com. > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |