RN API
RN: Round a Number (New)
This API call will allow the programmer to pass a numeric value in SCREEN-NUMERIC-FIELD. This field will be rounded based on the type or number of decimals provided and the results will be passed back in SCREEN-NUMERIC FIELD.
Screen Parameters: RN,t
t = T indicates this input field is a quantity field. The number of decimal places for the entry is determined based on the COMPANY-NO-OF-DECIMALS in the Company file.
t = M indicates this input field is an accumulator field.
The number of decimal places for the entry is determined based on the
COMPANY-NO-OF-DECIMALS-ACCUM in the Company file.
t = C indicates this input field is a cost field. The number
of decimal places is determined based on the COMPANY-NO-OF-DECIMALS-COST in the
Company file.
t = $ indicates this input field is a price field. The
number of decimal places is determined based on the
COMPANY-NO-OF-DECIMALS-PRICE in the Company file.
t = 0 through 5 specifies the number of decimals
to be rounded to.
NOTE: Type C for Cost: In versions 7.5 and 8.x of Elliott, there is not a value for Company-No-of-Decimals-Cost. Therefore, we will default to 4 for the number of decimals for a Cost value.
Type $ for Price: In versions 7.5 and 8.x of Elliott, there is not a value for Company-No-of-Decimals-Price. Therefore, we will default to 4 for the number of decimals for a Price value, unless the value of WS-NS5-UNIT-PRICE-2-DEC is “Y” – in that case we will use 2 for the number of Price decimals.
Examples:
API Call |
Number of Decimals |
Passed Value |
Return Value |
RN,P |
2 |
1000.13579 |
1000.14 |
RN,C |
4 |
1000.13579 |
1000.1358 |
CLS