Marc's Place

 

FN_E$BDG - Format number/amount to text

Inclusion in RPG source

C /COPY E$LIB/SRC(ILE),FN_E$BDG
C /COPY E$LIB/SRC(ILE),FN_E$CLZ

Invocation

EXSR E$BDG

Input Parameters

@BDG (d13.2)
Field in which the amount must be stored prior to the call to E$BDG.
 
@BDGN (d13.0)
Field in which the number must be stored prior to the call to E$BDG. If non-zero, the field has priority over @BDG.
 
@BDGFL (d1)
When 1, signals E$BDG to format the number or amount with 2 decimals.

Output Parameters

@BDGFM (a15)
Field in which the formatted number or amount is stored after processing by E$BDG.

What it does

Formats an amount or number in a numeric field into an alphanumeric field.

Examples

 *
 * Amount field = 6.2
 * Currency = NLG (= with comma)
 *
C                     Z-ADD1         @BDGFL
C                     Z-ADDAMOUNT    @BDG             (-40,00 -> -40,00)
C                     EXSR E$BDG
C                     MOVE @BDGFM    #FIELD    P      ('    40,00-')
 *
 * Amount field = 6.2
 * Currency = BFR (= without comma)
 *
C                     Z-ADD*ZERO     @BDGFL
C                     Z-ADDAMOUNT    @BDG             (-40,00 -> -40,00)
C                     EXSR E$BDG
C                     MOVE @BDGFM    #FIELD    P      ('     4000-')
 *
 * Numberfield  = 6.0
 * Has preference over Amount field
 *
C                     Z-ADDNUMBER    @BDGN            (-40 -> -40)    
C                     EXSR E$BDG
C                     MOVE @BDGFM    #FIELD    P      ('     40-')  
 *
 
Go to download page
© 1997- Marc Vos (and others)   -   Privacy Statement   -    Contact Me

On this website, Google Analytics is used to track visitor statistics. These are anonymised data about the number of visitors, which pages they visit on this site, from which regions they visit, which web browsers they use, etc.. You will also see non-personalised ads via Google AdSense. Cookies from Paddle or Paypal are placed when you click on a 'Buy now!' or 'Donate!' button, and possible cookies from Disqus when you use that system to comment on one or more blogposts.
Privacy Statement