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:

·        SCREEN-ALPHA-FIELD will be formatted to the maximum width set in the call, rounded first to match the type, if necessary, and then re-rounded if any decimal places are removed to fit the width specified.  If the input value is too big even after removing all decimals, a value of all 9s will be returned.

·        SCREEN-NUMERIC-FIELD will contain the input value rounded, if applicable, to the internal number of decimals as specified in the input type (T, M, C or $).

If the reserved space is not enough to enter all numbers with the full decimals, then the system layer will first eliminate the “,” markers for 1000 separator, as necessary.  If that is still not enough, we will truncate  (and round) the most insignificant decimals.  The space on the screen and reports are valuable, so we don’t want to always reserve the maximum space in order to make it work in all cases.  Instead, we want to reserve a reasonable amount of space where it will display or print correctly 99.99% of the time.  In the 0.01% scenario, the insignificant decimals are rounded off so that the information presented in the limited space would not cause significant misleading.

Screen-Parameters: FN,mx,tp,B 

mx = the maximum width of the field to be returned.

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. When t = T, p can have the following value:

p = “-“ means the field supports the minus sign in the last character of the maximum width to be returned.

p = “L“ means the field supports a leading minus sign instead of a trailing minus sign. This is used for CSV file support.

p = blank means no sign will be returned and the returned value will be right justified.

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. When t = M, p can have the following value:

p = “-“ means the field supports the minus sign in the last character of the maximum width to be returned.

p = “L“ means the field supports a leading minus sign instead of a trailing minus sign. This is used for CSV file support.

p = blank means no sign will be returned and the returned value will be right justified.

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. When t = C, p can have the following value:

p = “-“ means the field supports the minus sign in the last character of the maximum width to be returned.

p = “L“ means the field supports a leading minus sign instead of a trailing minus sign. This is used for CSV file support.

p = blank means no sign will be returned and the returned value will be right justified.

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. When t = $, p can have the following value:

p = “-“ means the field supports the minus sign in the last character of the maximum width to be returned.

p = “L“ means the field supports a leading minus sign instead of a trailing minus sign. This is used for CSV file support.

p = blank means no sign will be returned and the returned value will be right justified. 

B = Blank when zero

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

No. of Decimals

Passed Value

Return Value

1234567890123456

FN,12,T-

0

1000.000

      1,000

FN,12,TL

0

1000.000-

     -1,000

FN,12,T-

2

1000.000

  1,000.00

FN,13,$

5

1234567.12345

1234567.12345 (no commas)

FN,16,$

5

1234567.12345

 1,234,567.12345

FN,10,$

3

1234567.12456

1234567.12 (truncate/round decimals)

FN,10,$-

4

1234567.15234

1234567.2 (truncate/round decimals, leave room for sign)

FN,10,$-

4

1234567890.1234

999999999 (overflow)

FN,16,$

4

1234567.1234

  1,234,567.1234

FN,13,$

4

1234567.1234

1234,567.1234 (eliminate first comma)

 

Left or Right Alignment

The FN API always performs right alignment. On the other hand, the IN or DF API always performs left alignment.  

When you do printing, you need to perform right alignment.  Therefore, you will use the FN API.  

When you display a field on the screen, most of time, you want to do left alignment -- then you will use the IN or DF API.  When you need to do right alignment, then you will first use the FN API first to return the value to be displayed in SCREEN-ALPHA-FIELD, then follow by a DF call to display the SCREEN-ALPHA-FIELD.

CLS

Developer Documentations

  1. Received Code 9999 with Web Services Call
  2. Received Return Status Code 3 When Using Elilogin Login Method
  3. Elliott Web Service Requirements
  4. Elliott eStore Checklist
  5. LN API
  6. FN API
  7. RN API
  8. IN and DF API Change (V9.0)
  9. FA API Changes (V9.0)
  10. VA API Changes (V9.0)
  11. CartService
  12. EliarachService
  13. ElicshtxService
  14. EliattrbService
  15. ElisyscdService
  16. EliNoteService
  17. El2rstimService
  18. EliOrderService
  19. ItemInquiry
  20. EliitmiqService
  21. EliShiptoService
  22. El2getfrService
  23. Steps Required to Test ReportWriter in V8.2
  24. Installation of ElliottService, NETcellent’s Web Services for Elliott
  25. ResellerFinder
  26. EliaptrxService
  27. VendorInquiry
  28. EliloginService
  29. ElislsmnService
  30. EliserhsService
  31. EliatpobService
  32. ElievprcService
  33. ElihdtrxService
  34. ElicuswlService
  35. QueryTurnaround
  36. InvoiceInquiry
  37. ElicustmService
  38. EligetcdService
  39. OrderInquiry
  40. EliordiqService
  41. EliecontService
  42. EliautdpService
  43. El2CrCrdService
  44. Log-Timer / ElliottTimer.Ini Support
  45. Alpha Document Number Support (V8.5/V9.0)
  46. ElliottService System.TypeInitializationException
  47. Feature - Printing API to Dynamically Set Number of Copies
  48. The Values and Meanings of Distribution Types - ARDISFIL, APDISFIL, IMDISFIL, BMDISFIL
  49. DD API Changes (V9.0)
  50. PA API (8.5)
  51. Validate License API
  52. AP API
  53. TP API: Temporary Path
  54. Data Structures for Report Desk Defaults and Enforcements
  55. COBOL to VB Interface Programs
  56. IN API: Option to Support Files and Folders Validation
  57. FF API: File Functions
  58. ID API
  59. LK: Links API
  60. FFLNearYou
  61. Report Desk Developing and Debugging
  62. Developing a New Elliott V8.6 Report Desk User Defined Report (UDR)
  63. CustomerInquiry
  64. Elliott API (JSON Web Service)
  65. Animating COBOL Code in Elliott V8.5
  66. Preliminary Programming Changes for Elliott 8.6
  67. CV API
  68. System Lock File Requirements
  69. How to Write Test Codes for C# ESS Projects
  70. Solving the Inability to Debug Elliott on a New Server
  71. Report Desk: Developing Custom Reports
  72. Report Desk Tables
  73. Report Desk Database Delivery Strategy

Feedback and Knowledge Base