Hello LSEG Experts,
we have migrated from using the deprecated SFC C++ API to the new EMA SDK and we have noticed that there was a logic in place to handle the reception of signed 0 prices, according to this convention that is also mentioned in this thread:
[The positive zero (+0) represents a blank while the negative zero (-0) represents a numeric zero.](https://community.developers.refinitiv.com/discussion/comment/97247?utm_source=community-share#Comment_97247)
The question we have is actually around the treatment of the data, which in SFC is encoded in strings, while in the EMA world, the format is binary and proprietary.
[The key difference between SFC and RFA (OMM) and EMA is that SFC returns string-based data - so even numeric fields such as BID and ASK are returned in string format.](https://community.developers.refinitiv.com/discussion/comment/94611?utm_source=community-share#Comment_94611).
So, how is this edge case to be handled in the EMA world?
Is it correct to phrase it like this in code (C++ would fit better than describing it in plain English):
void AppClient::decode( const FieldList& fl )
{
while (fl.forth()) {
cout << "Fid: " << fl.getEntry().getFieldId() << " Name: " << fl.getEntry().getName() << " value: " << fl.getEntry().getLoad().toString() << endl;
if (fl.getEntry().getLoad().getDataType() == DataType::RealEnum) {
if (fl.getEntry().getCode() == Data::BlankEnum) {
cout << "+0 received" << endl;
}
else if (fl.getEntry().getReal().getMantissa() == 0){
cout <<"-0 received" << endl;
}
else {
cout << "non-zero value: " << fl.getEntry().getReal().getAsDouble() << endl;
}
}
(previous snippet adapted from here: https://community.developers.refinitiv.com/discussion/comment/121983?utm_source=community-share#Comment_121983)