Re: [SPAM] Re: [Quickfix-developers] price as double
Brought to you by:
orenmnero
From: Oren M. <or...@qu...> - 2004-04-15 14:12:39
|
The C++ fields have a setString and getString method. You can use=20 these to guarantee a perfect representation of your number. Java=20 doesn't have access to these, so it would need to be added to the API. =20= We can also replace the DoubleField with a BigDecimal field, or add=20 BigDecimal support to the existing field type. --oren On Apr 15, 2004, at 4:02 AM, Joerg Thoennes wrote: > Oren, > > with the Java API I have this problem form months. Doubles are not=20 > used in financial applications because of these rounding errors. In=20 > Java, we use BigDecimal in such cases. It would be good to have access=20= > to the String representation of a FIX field, ie get/set the value of=20= > all fields as String. How could I do that in C++ and Java? > > Cheers, J=F6rg > >> Can you please indicate what system you are running on and which API=20= >> 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=20= >>> of the decimal point. I supply price=3D93.19 to a newOrderSingle=20 >>> object and the actual string passed to the counterparty contains=20 >>> 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=20= >>> and append 44=3D93.19 to it and creating a message through this = string=20 >>> but this new message fails validation. >>> >>> 2) Is there anyway to get a string out without the header and=20 >>> trailer (i.e. just get the body), change the body and create a new=20= >>> message that constructs the header and trailer based on message=20 >>> 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=3D1470&alloc_id=3D3638&op=3Dclic= k >>> _______________________________________________ >>> 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=3D1470&alloc_id=3D3638&op=3Dc= lick >> _______________________________________________ >> Quickfix-developers mailing list >> Qui...@li... >> https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > > --=20 > 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 > > > ------------------------------------------------------- > 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=3D1470&alloc_id=3D3638&op=3Dcl= ick > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |