Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Elektron /
  • EMA /
avatar image
Question by ye.li · May 05, 2020 at 02:25 PM · ema c++

EMA C++ post message, value after decimal point is truncated

I am using the EMA C++ for posting messages into TRCC. I used addRealFromDouble to add double value to the FieldList. Posting works okay, however the value in TRCC ended up as 1 instead of the contributed 1.0038759000

_fList.addRealFromDouble(21, 1.0038759000 ); /* HST_CLOSE */
_fList.addRealFromDouble(393, 1.0038759000 ); /* PRIMACT_1 */

I tried addDouble, but that has limitation on the length of the value.

questions:

1. Why the value is truncated?

2. What is the better way to post double value?

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by umer.nalla · May 05, 2020 at 02:46 PM

Hi @ye.li

the parameters for addRealFromDouble are:

fieldId field id value
value added double to be converted to OmmReal
magnitudeType OmmReal::magnitudeType used for the conversion (default value is OmmReal::Exponent0Enum)


For non-integer values, you need to specify the MagnitudeType e.g. ExponentNeg7Enum

See documentation for enum thomsonreuters::ema::access::OmmReal::MagnitudeType for full list.

The format you are using is for Integer values i.e. default value of Exponent0Enum

Comment

People who like this

0 Show 2 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
ye.li · May 05, 2020 at 04:06 PM 0
Share

So that means when use the addRealFromDouble(), I still need to track how many digits after the decimal point, and set up the corresponding magnitude in the last function parameter. Is it right?

avatar image
REFINITIV
umer.nalla ♦♦ ye.li · May 05, 2020 at 06:29 PM 0
Share

Hi @ye.li

Correct - the difference between this and the addReal is that this saves you having to convert your real number to an int mantissa value.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
8 People are following this question.

Related Questions

EMA TRCC OmmMemoryExhaustionException

Unsupported environment in EMA

EMA TRCC C++ - Error Text Initialization timed out.

Are onRefreshMsg, onUpdateMsg and onStatusMsg callbacks guaranteed to be always called on the same single thread

Compiling EMA 1.3.0L1 Windows

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges