FUNCTION SayRupiah(par)
LOCAL nTot,nRp,cRp,cRupiah
ntot = 0
cRupiah=”"
lExit = .F.
nTot = par
cTotal= ALLTRIM(STR(nTot))
FOR i=1 TO LEN(cTotal)
nRp= (LEN(SUBSTR(cTotal,i)))
cRp= SUBSTR(cTotal,i,1)
DO CASE
CASE nRp > 0
GetDetailRupiah(nRp,cRp,@cRupiah)
CASE nRp < 0
nRp= nRp + 3
GetDetailRupiah(nRp,cRp,@cRupiah)
CASE nRp = 0
cRupiah = cRupiah
ENDCASE
NEXT
IF nTot - INT(nTot) > 0
cRupiah = cRupiah
ENDIF
RETURN cRupiah + “RUPIAH



Entries (RSS)