Re: [Quickfix-developers] price as double
Brought to you by:
orenmnero
From: Joerg T. <Joe...@ma...> - 2004-04-15 09:03:17
|
Oren, with the Java API I have this problem form months. Doubles are not used in financial applications because of these rounding errors. In Java, we use BigDecimal in such cases. It would be good to have access to the String representation of a FIX field, ie get/set the value of all fields as String. How could I do that in C++ and Java? Cheers, Jörg > Can you please indicate what system you are running on and which API you > are using? > > --oren > > On Apr 14, 2004, at 11:36 AM, Vijay Singh Yadav wrote: > >> Hello, >> 1.) Is there a way to force prices to respect only two digits right of >> the decimal point. I supply price=93.19 to a newOrderSingle object and >> the actual string passed to the counterparty contains 93.19000244 >> >> The counterparty does not like this and rejects the order. >> >> I tried calling msg.toString to get the string out without the price >> and append 44=93.19 to it and creating a message through this string >> but this new message fails validation. >> >> 2) Is there anyway to get a string out without the header and trailer >> (i.e. just get the body), change the body and create a new message >> that constructs the header and trailer based on message body. >> >> Thanks for your help >> >> -- vijay >> ------------------------------------------------------- >> This SF.Net email is sponsored by: IBM Linux Tutorials >> Free Linux tutorial presented by Daniel Robbins, President and CEO of >> GenToo technologies. Learn everything from fundamentals to system >> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >> _______________________________________________ >> Quickfix-developers mailing list >> Qui...@li... >> https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > -- Joerg Thoennes http://macd.com Tel.: +49 (0)241 44597-24 Macdonald Associates GmbH Fax : +49 (0)241 44597-10 Lothringer Str. 52, D-52070 Aachen |