Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
3 numbers after point
Message
De
19/06/2007 07:14:03
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
3 numbers after point
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01234191
Message ID:
01234191
Vues:
41
hi all,

i try to display 3 number without any round ,after point as character , i see 2 numbers all the time and roundit,

i try to change this line aloan it works as numbers, but space as characters

thank you for help.
ex..
lccurdaci=7798.697
lccurdaci=RIGHT(ALLTRIM(STR(lncurrency,11,3)),3)
? lccurdaci....7798.697
the all code is..
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=' ÝÞØ áÇ ÛíÑ'&& as just only
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)+' ÝáÓ'&& as FILS
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='æ'
 endif
 lchundred=lchundredver
 IF lchundred!='0'
 lchundred=lchundred+'00'
 SEEK lchundred
 lchundredtxt=ALLTRIM(arvalue)
 lchundredsep=' æ '
 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=' æ '
 IF lcthousand1='0' AND VAL(SUBSTR(lccurrency,4,2))<3 AND VAL(SUBSTR(lccurrency,4,2))>0
 lcthousandtxt1=ALLTRIM(arvalue)+' ÇáÝ'
 ENDIF
endif 
  lcthousandver=SUBSTR(lccurrency,4,2)
 lcthousand=lcthousandver
 IF lcthousand!='00'
	 IF VAL(SUBSTR(lcthousand,1,2))>10
	  SEEK lcthousand
	    		lcthousandtxt=ALLTRIM(arvalue)+ ' ÃáÝ'
  		lcthousandsep=' æ'
 	 ENDIF
 	 IF VAL(SUBSTR(lcthousand,1,2))=10
		 lcthousand=lcthousand+'000'
		  SEEK lcthousand
		  lcthousandtxt=ALLTRIM(arvalue)
		  lcthousandsep=' æ'
	ENDIF
	IF VAL(SUBSTR(lcthousand,1,2))<10 
 		lcthousand=SUBSTR(lcthousand,1,2)&&+'00' &&
		 SEEK lcthousand
  		lcthousandtxt=ALLTRIM(arvalue)+' ÇáÝ'
  		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=' æ'
  		endif
	endif
  ENDIF
  IF lcthousand='00' AND SUBSTR(lccurrency,3,1)!='0'
  		lcthousandtxt=' ÇáÝ'
  		lcthousandsep=' æ'
  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)+' ãáíæä'
ELSE
lcmilliontxt=ALLTRIM(arvalue)
endif
lcmillionsep=' æ '
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='  ÕÝÑ ÝÞØ áÇ ÛíÑ '
endif
ENDIF
IF LEN(lccurdacisep1)>0
lcriyal= ' ÏíäÇÑ ÃÑÏäí' && AS US DOLLAR
ELSE
lcriyal=''
endif
lcallstr=ALLTRIM(lcmilliontxt+lcmillionsep+lcthousandtxt1+lcthousand1sep+lcthousandtxt+lcthousandsep+;
lchundredtxt+lchundredsep+lctentxt+lcriyal+lccurdacisep+lccurdacitxt+lcnothing)

RETURN lcallstr
thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform