Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Decimal Places
Message
De
22/12/1999 00:17:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
22/12/1999 00:00:41
Amit Abhangrao
Charmi Software Exports
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00306105
Message ID:
00307146
Vues:
33
That's what I cannot understand.
len(substr(allt(padr(lnVar,20)), at(".", allt(padr(lnVar,20)) )+1 ) )

should return 3 for 130. IOW it means :

len(substr(allt(padr(lnVar,20)), 1))

You could then use :
iif(at(".",padl(lnVar,20))=0,0,....)
Cetin

>Hi Cetin,
>
> The problem is
> it returns 1 if the value is 130.9
> it returns 1 if the value is 130.0 is right
> but the problem is it returns 1 even if the value us just 130 and not decimal places
>
>Thanks
>Amit
>
>
>
>
>I expected it to return number of digits in integer part (3 for 130.9898).
>I think you mean you threat 130.0000 with no decimal places. Then make it :
>iif(int(lnVar)=lnVar,0,;
> len(substr(allt(padr(lnVar,20)), at(".", allt(padr(lnVar,20)) )+1 ) ))
>If you use VFP6 then Doug's method is shorter.
>Cetin
>Çetin Basöz
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform