Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • DSS /
avatar image
REFINITIV
Question by aleksandra.kluczniak · Aug 17, 2016 at 05:33 AM · dss rest apidecimal places

DSS - REST API - Decimal Places set up

Question from the client, who is using REST API, HTTP, Intraday Report Template:

Fields impacted: Bid Price, Ask Price, Last Price

'The number of decimals that is returned for rates by TR is inconsistent, see example in attachment (SAREUR=R.png). Is there any way to specify the number of decimals that should be returned?'

Like it is possible to set decimals in GUI? If so, could you please explain how?

Thank you.
cusersu8018938documentssareurr.png (6.7 KiB)

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.

4 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by veerapath.rungruengrayubkul · Aug 19, 2016 at 01:24 AM

Hi,

You can use ContentFieldNumberFormat for specifying custom number formatting for the numeric fields, when you create the IntradayPricing report template. The related properties are DecimalPlaces and UseTrailingZero. I have tried the DecimalPlaces: 10 and UseTrailingZero: true and get the .2351000000 for bid price.

For example of usage, please see this link

For detailed information about the properties, please see this link

You can also do it in GUI by edit the selected fields in report template page.

Hope this helps.


edit.png (27.3 KiB)
Comment

People who like this

0 Show 4 · 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
REFINITIV
kazuhisa.matsuda · Aug 22, 2020 at 12:35 AM 0
Share

Hi Veerapath,

Could you share your program ?

regards,

avatar image
REFINITIV
veerapath.rungruengrayubkul ♦♦ kazuhisa.matsuda · Aug 24, 2020 at 03:01 AM 0
Share

Hi @kazuhisa.matsuda,

The example of custom field can be found here. You can also find the workflow of Schedule extraction on this tutorial. You can modify the "Create a report template" section to customize decimal place of fields. Let me know if you need further information.

avatar image
REFINITIV
kazuhisa.matsuda veerapath.rungruengrayubkul ♦♦ · Aug 27, 2020 at 01:34 PM 0
Share

Hi Veerapath,

Thank you very much for your response. I am trying to use On Demand in this time. According to Rick's comment, I can get raw data using ExtractWithNotes(). I used 'US0268741560', 'Isin', US1491501128', 'Isin and Fields are 'Asset Ratio For', 'Asset Ratio Against'.

I supposed to get non 1 for 'Asset Ratio For' field but still getting 1. Can I have a hint to find a solution?

regards,

Kaz


avatar image
REFINITIV
Answer by Rick Weyrauch · Aug 17, 2016 at 08:32 AM

The REST API follows the OData spec, which follows the JSON spec (http://www.json.org/). The OData spec is a raw-data, data-transport spec and so the data is sent in the most minimal (and mostly un-formatted) fashion. I have to check with our internal expert, but trailing zeros look to violate the JSON number spec as only a leading 0 for fully fractional numbers is specified:

It is not the most minimal for data transport.


json-numberspec.png (55.6 KiB)
Comment
Troy Dalldorf

People who like this

1 Show 0 · 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
REFINITIV
Answer by gteage01 · Aug 17, 2016 at 08:37 AM

Hi,

Looks as though you'd want something similar on DSS to the equivelent of TRD_UNIT (FID: 53) on Eikon, so the Developer can combine this to force the number to include trailing zeros correctly, is that the case?

If so in DSS try combining with the "Price Decimals" field on the Intraday extraction.

Best regards,

Gareth

Comment

People who like this

0 Show 0 · 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
REFINITIV
Answer by Rick Weyrauch · Aug 19, 2016 at 04:32 PM

There is really 2 ways to get results from the REST API: Legacy (or scheduled extractions) and On Demand.

In a scheduled extraction, the results are all formatted via the Report Template Field Definitions, but then what you get via the REST API are file references to the results of the extraction, which as I say, are formatted per the Report Template. You are fetching a file stored on our system.

For On Demand, there is no place to specify formatting, there is just a field list, and the results are returned as the REST content of the ExtractWithNotes() request. This result is a JSON result and not formatted, but is intended to be a raw feed of the raw data that matches the request.

Comment
Troy Dalldorf

People who like this

1 Show 0 · 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.

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 >
10 People are following this question.

Related Questions

DSS legal Entity Fields

Could you please let me know, Will API return only positive rate values or negative rate values also ?

DSS REST API python sample of user preferences change

Requesting entity details for TR OrgIDs does not return data for some OrgIDs

DSS REST API: Sometimes the create token API returns an invalid token

  • 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