{{Quickfixn}} Problem parsing Amt fields

Jeays, Mark Mark.Jeays at bmo.com
Mon Dec 1 12:59:52 PST 2014


Hi List,

I've run into the following error trying to parse a TradeCaptureReport using QuickFix/n

QuickFix.MessageParseError: Could not parse message: Error at position (355) while parsing msg
...
System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Convert.ToInt32(String value)
   at QuickFix.Message.ExtractField(String msgstr, Int32& pos, DataDictionary sessionDD, DataDictionary appDD)
   --- End of inner exception stack trace ---
   at QuickFix.Message.ExtractField(String msgstr, Int32& pos, DataDictionary sessionDD, DataDictionary appDD)
   at QuickFix.Message.ExtractField(String msgstr, Int32& pos)
   at QuickFix.Session.Next(String msgStr)
   at QuickFix.SocketInitiatorThread.ProcessStream()
   at QuickFix.SocketInitiatorThread.Read()


Position 355 corresponds to the decimal place in an Amt field for accrued interest:

159=120865.75

We've also noticed this same issue for another Amt field, NetMoney.

These are the Data definitions for the fields:

<field number='118' name='NetMoney' type='AMT'/>
<field number='159' name='AccruedInterestAmt' type='AMT'/>

It seems that QF is interpreting these as an integer instead of as a decimal. The specification states that the Amt data type has a float as a base type and the example shows two decimal places.

How would I get QF to parse this as a decimal?

Thanks,

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20141201/c810de77/attachment.htm>


More information about the Quickfixn mailing list