Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert vb code to vfp code
Message
From
22/07/2007 08:45:52
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01242547
Message ID:
01242608
Views:
10
hi,
if you don't mind i can sent small table where English number and words =
Arabic number and words.

thanks.



>I'm not sure I can really help, since I don't know Arabic and don't recall well numbers in Hebrew either.
>
>I can, of course, try to ask my husband later today.
>
>In the meantime I found
>http://www.dotnet2themax.com/blogs/fbalena/SearchView.aspx?q=numbertotext (generic algorithm)
>
>and checked Downloads section here, but it doesn't seem like we have Arabic version for NumToWords problem.
>
>>hi,
>>thank you for reply,
>>about convert i'll try.
>>
>>but what i need....
>>i try to get code to print Arabic check,
>>i have this code under the first part work fine, the second part i need to convert it to display number as numbers not words , and 3 numbers without rounding ex... (.897 cent).
>>
>>pls, if you can help me to fix it.
>>
>>
>>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)+' &#1607;&#1604;&#1604;&#1577;'&¢
>>lccurdacisep=' &#1608;'
>>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='&#1608;'&&and
>> endif
>> lchundred=lchundredver
>> IF lchundred!='0'
>> lchundred=lchundred+'00'
>> SEEK lchundred
>> lchundredtxt=ALLTRIM(arvalue)
>> lchundredsep=' &#1608; '&&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=' &#1608; '&&and
>> IF lcthousand1='0' AND VAL(SUBSTR(lccurrency,4,2))<3 AND VAL(SUBSTR(lccurrency,4,2))>0
>> lcthousandtxt1=ALLTRIM(arvalue)+' &#1575;&#1604;&#1601;'&&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)+ ' &#1571;&#1604;&#1601;'&&thousand
>>  		lcthousandsep=' &#1608;'&&and
>> 	 ENDIF
>> 	 IF VAL(SUBSTR(lcthousand,1,2))=10
>>		 lcthousand=lcthousand+'000'
>>		  SEEK lcthousand
>>		  lcthousandtxt=ALLTRIM(arvalue)
>>		  lcthousandsep=' &#1608;'&&and
>>	ENDIF
>>	IF VAL(SUBSTR(lcthousand,1,2))<10
>> 		lcthousand=SUBSTR(lcthousand,1,2)&&+'00' &&
>>		 SEEK lcthousand
>>  		lcthousandtxt=ALLTRIM(arvalue)+' &#1575;&#1604;&#1601;'&&thousand
>>  		lcthousandsep=' &#1608;'
>>  		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=' &#1608;'&&and
>>  		endif
>>	endif
>>  ENDIF
>>  IF lcthousand='00' AND SUBSTR(lccurrency,3,1)!='0'
>>  		lcthousandtxt=' &#1575;&#1604;&#1601;'&&thousand
>>  		lcthousandsep=' &#1608;'&&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)+' &#1605;&#1604;&#1610;&#1608;&#1606;'&&milion
>>ELSE
>>lcmilliontxt=ALLTRIM(arvalue)
>>endif
>>lcmillionsep=' &#1608; '&&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='  &#1589;&#1601;&#1585; &#1601;&#1602;&#1591; &#1604;&#1575; &#1594;&#1610;&#1585; '&& only zero
>>endif
>>ENDIF
>>IF LEN(lccurdacisep1)>0
>>lcriyal= ' &#1585;&#1610;&#1575;&#1604;'&&$us dollar
>>ELSE
>>lcriyal=''
>>endif
>>lcallstr=ALLTRIM(lcmilliontxt+lcmillionsep+lcthousandtxt1+lcthousand1sep+lcthousandtxt+lcthousandsep+;
>>lchundredtxt+lchundredsep+lctentxt+lcriyal+lccurdacisep+lccurdacitxt+lcnothing)
>>
>>RETURN lcallstr
>>
>>
>>
>>
>>>Don't remember FORMAT funciton, but AFAIK it's similar to transform.
>>>http://msdn2.microsoft.com/en-us/library/59bz1f0h.aspx
>>>
>>>MID, AFAIK, is equavalent of SUBSTR()
>>>http://msdn2.microsoft.com/en-us/library/05e63829.aspx
>>>
>>>Case is easily translated to DO CASE.
>>>
>>>So, you should be able to translate this code easily.
>>>
>>>>hi,
>>>>thank you for reply,
>>>>Which bit are you having trouble with? all
>>>>
>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform