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.Best Answer
-
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.
0
Answers
-
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.
0 -
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
0 -
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.
0 -
Hi @Zuka1,
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.
0 -
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
0 -
Hi @Zuka1,
The custom field format currently is not supported on On Demand extraction. You need to use Schedule Extraction.
I have tried to increase decimal place for the fields and extract data with Schedule extraction. I can get ',9425071' and '1' on 'Asset Ratio For', and 'Asset Ratio Against' respectively for the US0268741560.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 687 Datastream
- 1.4K DSS
- 623 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 557 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 276 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 689 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 105 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 91 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛