>>PARAMETERS lncurrency >> >>LOCAL lcnothing >>LOCAL lcten,lchundred,lcthousand,lcthousand1,lcmillion >>LOCAL lnlenstr,lccurrency,lccurdaci,lcriyal >>LOCAL lctentxt,lchundredtxt,lcthousandtxt,lcmilliontxt,lcthousandtxt1 >>LOCAL lctensep,lchundredsep,lcthousandsep,lcthousandsep1,lcmillionsep >>LOCAL lcallstr,lchundredver >>lcnothing=' فقط لا غير'&& only or just >>STORE '' TO lctentxt,lchundredtxt,lcthousandtxt,lcmilliontxt,lcthousandtxt1,lcriyal >>STORE '' TO lctensep,lchundredsep,lcthousandsep,lcthousand1sep,lcmillionsep >>STORE '0' TO lchundredver,lcthousand1ver,lcthousand1 >>STORE '00' TO lcten,lcthousand >>lccurrency=ALLTRIM(STR(INT(lncurrency))) && will display like 14 >>lccurdaci=RIGHT(ALLTRIM(STR(lncurrency,11,2)),2)&& will display only decimal side >>lnlenstr=LEN(ALLTRIM(STR(INT(lncurrency)))) && will caculate str lenght >>IF lnlenstr<1 >>RETURN .f. >>ENDIF >> >>SELECT arver >>SET ORDER TO no >> >> >>IF lccurdaci!='00' >>SEEK lccurdaci >>lccurdacitxt=ALLTRIM(arvalue)+' هللة'&¢ >>lccurdacisep=' و' >>ELSE >>lccurdacitxt='' >>lccurdacisep='' >>endif >>lccurrency=PADL(lccurrency,8,'0') >>lcten=lccurrency >>lcten=SUBSTR(lccurrency,7,2) >>lchundredver=SUBSTR(lccurrency,6,1) >>*!* IF !USED('arver') >>*!* USE arver IN 0 >>*!* SET ORDER TO no >>*!* endif >> IF lcten!='00' >> SEEK lcten >> lctentxt=ALLTRIM(arvalue) >> lctensep='و'&&and >> endif >> lchundred=lchundredver >> IF lchundred!='0' >> lchundred=lchundred+'00' >> SEEK lchundred >> lchundredtxt=ALLTRIM(arvalue) >> lchundredsep=' و '&&and >> endif >> IF lcten='00' >> lchundredsep='' >> ENDIF >> lcthousand1ver=SUBSTR(lccurrency,3,1) >> lcthousand1=lcthousand1ver >> IF lcthousand1!='0' >> lcthousand1=lcthousand1+'00' >> SEEK lcthousand1 >> lcthousandtxt1=ALLTRIM(arvalue) >> lcthousand1sep=' و '&&and >> IF lcthousand1='0' AND VAL(SUBSTR(lccurrency,4,2))<3 AND VAL(SUBSTR(lccurrency,4,2))>0 >> lcthousandtxt1=ALLTRIM(arvalue)+' الف'&&thousand >> ENDIF >>endif >> lcthousandver=SUBSTR(lccurrency,4,2) >> lcthousand=lcthousandver >> IF lcthousand!='00' >> IF VAL(SUBSTR(lcthousand,1,2))>10 >> SEEK lcthousand >> lcthousandtxt=ALLTRIM(arvalue)+ ' ألف'&&thousand >> lcthousandsep=' و'&&and >> ENDIF >> IF VAL(SUBSTR(lcthousand,1,2))=10 >> lcthousand=lcthousand+'000' >> SEEK lcthousand >> lcthousandtxt=ALLTRIM(arvalue) >> lcthousandsep=' و'&&and >> ENDIF >> IF VAL(SUBSTR(lcthousand,1,2))<10 >> lcthousand=SUBSTR(lcthousand,1,2)&&+'00' && >> SEEK lcthousand >> lcthousandtxt=ALLTRIM(arvalue)+' الف'&&thousand >> lcthousandsep=' و' >> IF VAL(SUBSTR(lcthousand,1,2))<10 AND SUBSTR(lccurrency,4,1)='0' AND SUBSTR(lccurrency,3,1)='0' >> lcthousand=SUBSTR(lcthousand,2,1)+'000' && >> SEEK lcthousand >> lcthousandtxt=ALLTRIM(arvalue) >> lcthousandsep=' و'&&and >> endif >> endif >> ENDIF >> IF lcthousand='00' AND SUBSTR(lccurrency,3,1)!='0' >> lcthousandtxt=' الف'&&thousand >> lcthousandsep=' و'&&and >> ENDIF >> >> IF lcten='00' AND lchundred='0' >> lcthousandsep='' >> endif >> IF lcthousand='00' >> lcthousand1sep='' >> endif >> >> lcmillion=SUBSTR(lccurrency,1,2) >> IF lcmillion!='00' >> IF SUBSTR(lccurrency,2,1)!='0' AND SUBSTR(lccurrency,1,1)='0' >> lcmillion=SUBSTR(lccurrency,2,1)+'000000' >> ENDIF >> IF SUBSTR(lccurrency,1,1)!='0' >> lcmillion=SUBSTR(lccurrency,1,2) >> endif >> SEEK lcmillion >>IF SUBSTR(lccurrency,1,1)!='0' >>lcmilliontxt=ALLTRIM(arvalue)+' مليون'&&milion >>ELSE >>lcmilliontxt=ALLTRIM(arvalue) >>endif >>lcmillionsep=' و '&&and >>ENDIF >> >> IF lcten='00' AND lchundredver='0' AND SUBSTR(lccurrency,4,2)='00' >> lcthousandsep='' >> ENDIF >> IF lcten='00' AND lchundredver='0' >> lchundredsep='' >> ENDIF >> IF lcten='00' AND lchundredver='0' AND lcthousand='00' AND lcthousand1='0' >> lcmillionsep='' >> ENDIF >>lccurdacisep1=alLTRIM(lcmilliontxt+lcmillionsep+lcthousandtxt1+lcthousand1sep+lcthousandtxt+lcthousandsep+; >>lchundredtxt+lctentxt) >>lccurdacisep1=ALLTRIM(lccurdacisep1) >>IF LEN(lccurdacisep1)=0 >>lccurdacisep='' >>IF LEN(lccurdacisep1)=0 AND LEN(lccurdacitxt)=0 >>lcnothing=' صفر فقط لا غير '&& only zero >>endif >>ENDIF >>IF LEN(lccurdacisep1)>0 >>lcriyal= ' ريال'&&$us dollar >>ELSE >>lcriyal='' >>endif >>lcallstr=ALLTRIM(lcmilliontxt+lcmillionsep+lcthousandtxt1+lcthousand1sep+lcthousandtxt+lcthousandsep+; >>lchundredtxt+lchundredsep+lctentxt+lcriyal+lccurdacisep+lccurdacitxt+lcnothing) >> >>RETURN lcallstr >>>>