RN API

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



    • Related Articles

    • FN API

      FN: Format Number (New) This API call will allow the programmer to pass a numeric value in SCREEN-NUMERIC-FIELD. This field will be formatted based on type and maximum size provided, and the results will be passed back as follows: · ...
    • Programming API Codes

      This document is provided for Elliott software developers. If you are not an Elliott software developer, this document is not meaningful for you. AP: Get SMA Values This API returns various values from the Shared Memory Area. For example: Move ‘AP’ ...
    • GK API

      Release Date: 07/08/2021 Revised Date: 05/05/2022 This API allows the programmer to determine whether or not certain keystrokes have been pressed. Screen-Parameters: GK,nn nn provides different functionality as follows: GK Wait for the next keystroke ...
    • FA API Changes (V9.0)

      FA: File Access (Without File Handling) This API can be used to retrieve an individual field from a specific record in a file without specifying the file in the program and without opening and closing the file. In its simplest form, one can, for ...
    • DN API (Document Number Handling)

      Release: 1/11/2021 Version: V8.5 and higher DN API: Document Number Increase, Roll Back or Validate In Elliott V8.5, the system supports alphabetic document numbers. The logic to sequentially assigning the next document number is complicated. For ...