0
votes

I want to do thousand separates for this value 100000000. How can i do it in progress.

Sample Code

DEFINE VARIABLE mAmount AS DECIMAL  NO-UNDO.
ASSIGN mAmount = 100000000.
MESSAGE mAmount VIEW-AS ALERT-BOX INFO BUTTONS OK TITLE "Amount".
2

2 Answers

6
votes

The MESSAGE statement does not format the variable. You have to convert it to a STRING and provide the correct format.

MESSAGE STRING(mAmount, "zzz,zzz,zz9") VIEW-AS ALERT-BOX INFO BUTTONS OK TITLE "Amount".

The DISPLAY statement does use the format which is defined in the DEFINE VARIABLE statement, or you can use a custom format with the FORMAT statement. Example:

DEFINE VARIABLE mAmount AS DECIMAL FORMAT "zzz,zzz,zz9" NO-UNDO.
ASSIGN mAmount = 100000000.
DISPLAY mAmount WITH FRAME a.
DISPLAY mAmount FORMAT "zzzzzz,zz9" WITH FRAME b.
0
votes

you may also use: ">>>,>>>,>>9" in format.