ACRFDOLL ;IHS/OIRM/DSD/THL,AEF - CONVERT NUMERIC DOLLARS TO ALPHA STATEMENTS; [ 11/01/2001 9:44 AM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
;;ROUTINE USED TO CONVERT NUMERIC DOLLARS TO ALPHA STATEMENTS
EN D EN1
EXIT K ACR
Q
EN1 S X=$P(ACRAMT,".")
S ACRL=$L(X)
S ACRAMTX=""
F ACRI=1:1:$L(X) D
.S ACRY=$E(X,ACRI)
.S ACRI($L(X)-ACRI+1)=ACRY
S X=0
F S X=$O(ACRI(X)) Q:'X D
.S ACRNUM=$S(X=2!(X=5)!(X=8):$P($T(@(ACRI(X)_0)),";;",2),1:$P($T(@ACRI(X)),";;",2))
.S:ACRNUM]"" ACRAMTX=ACRNUM_$S(X#3=0:" HUNDRED",1:"")_$S(X=7:" MILLION",X=4:" THOUSAND",1:"")_" "_ACRAMTX
Q
0 ;;
1 ;;ONE
2 ;;TWO
3 ;;THREE
4 ;;FOUR
5 ;;FIVE
6 ;;SIX
7 ;;SEVEN
8 ;;EIGHT
9 ;;NINE
10 ;;TEN
20 ;;TWENTY
30 ;;THIRTY
40 ;;FORTY
50 ;;FIFTY
60 ;;SIXTY
70 ;;SEVENTY
80 ;;EIGHTY
90 ;;NINETY
ACRFDOLL ;IHS/OIRM/DSD/THL,AEF - CONVERT NUMERIC DOLLARS TO ALPHA STATEMENTS; [ 11/01/2001 9:44 AM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
+2 ;;ROUTINE USED TO CONVERT NUMERIC DOLLARS TO ALPHA STATEMENTS
EN DO EN1
EXIT KILL ACR
+1 QUIT
EN1 SET X=$PIECE(ACRAMT,".")
+1 SET ACRL=$LENGTH(X)
+2 SET ACRAMTX=""
+3 FOR ACRI=1:1:$LENGTH(X)
Begin DoDot:1
+4 SET ACRY=$EXTRACT(X,ACRI)
+5 SET ACRI($LENGTH(X)-ACRI+1)=ACRY
End DoDot:1
+6 SET X=0
+7 FOR
SET X=$ORDER(ACRI(X))
IF 'X
QUIT
Begin DoDot:1
+8 SET ACRNUM=$SELECT(X=2!(X=5)!(X=8):$PIECE($TEXT(@(ACRI(X)_0)),";;",2),1:$PIECE($TEXT(@ACRI(X)),";;",2))
+9 IF ACRNUM]""
SET ACRAMTX=ACRNUM_$SELECT(X#3=0:" HUNDRED",1:"")_$SELECT(X=7:" MILLION",X=4:" THOUSAND",1:"")_" "_ACRAMTX
End DoDot:1
+10 QUIT
0 ;;
1 ;;ONE
2 ;;TWO
3 ;;THREE
4 ;;FOUR
5 ;;FIVE
6 ;;SIX
7 ;;SEVEN
8 ;;EIGHT
9 ;;NINE
10 ;;TEN
20 ;;TWENTY
30 ;;THIRTY
40 ;;FORTY
50 ;;FIFTY
60 ;;SIXTY
70 ;;SEVENTY
80 ;;EIGHTY
90 ;;NINETY