[This message was posted by Vladyslav Lazarenko of Jet SnaiL, LLC 
<[email protected]> to the "General Q/A" discussion forum at 
http://fixprotocol.org/discuss/22. You can reply to it on-line at 
http://fixprotocol.org/discuss/read/755ef17a - PLEASE DO NOT REPLY BY MAIL.]

Amrit,

I definitely agree with you. FIX engine's responsibility is to transmit 
messages across the network and take care about reliability on top of TCP/IP. 
Nothing less, nothing more.

>From my experience, people are usually having troubles converting 
>floating-point number into string when exchange accepts 4 digits for prices 
>less than $1 and 2 for $1 or more. If that is the case, then we need to round 
>floating-point number using the best model (which usually is very specific) 
>and convert it into a string with a given precision.

There is a good explanation of rounding models in wiki article - 
http://en.wikipedia.org/wiki/Floating_point#Rounding_modes

For example, someone may want to round down when buying and up when selling.

To convert floating-point to a string, I would recommend using 'snprintf()' 
function which conforms to ISO C99 standard (ISO/IEC 9899:1999). It allows you 
to specify a precision.

Beware that this trick might not be very straight forward with some FIX engines 
that provide you with a type-safe interface. For example, in QuickFIX you have 
to explicitly work with 'FIX::StringField' class instead of 'FIX::Price' to be 
able to assign a string to a floating-point field.

If none of the above is possible, you might of course use FIX engine's rule to 
do this work if your FIX engine allows it. But this is not a part of standard 
and, most importantly, do not expect that to work fast.

- Vlad


[You can unsubscribe from this discussion group by sending a message to 
mailto:[email protected]]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Financial Information eXchange" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/FIX-Protocol?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to