Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Decimal Places
Message
From
21/12/1999 23:52:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
21/12/1999 23:30:47
Amit Abhangrao
Charmi Software Exports
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00306105
Message ID:
00307137
Views:
25
>Hi Leonard,
>
> Thanx for your reply. It works fine but problem is if my variable doesnt have any decimal places, it returns 1. How can i solve this problem?
>
>Regards
>Amit
>
>
>len(substr(allt(padr(130.9898,20)), at(".", allt(padr(130.9898,20)) )+1 ) )


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

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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform