Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / want to do away with extended averages

Author
Message
sinkler20
21
Years of Service
User Offline
Joined: 12th Mar 2003
Location: United States
Posted: 30th Aug 2004 05:26
need help
i'm trying print a Bating average on a read data, and it does but it prints out, for example 0.26776754364. and I just want it to print out .267
I'm sure if I convert it to a string I could get it to print out what i want.
I know in visual basic I could use something like .### (or something)
any help would be nice.
David

philippians 4:13
Zokomoko
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 30th Aug 2004 05:40
DBC or DBP ?

if DBP:

result$=str$(result#)
result$=left$(result$,5)

you convert the float into a string, using the string$=str$(number) function. Then, you want only 3 digits after the dot(0.267), but you also count the 0, and the dot itself, so you want 5 digits total. Use the string$=left$(string$,5), the function will take 5 digits from the left side of the string.
There are more functions like this, like right$(string$,num)..
look into the DBPRO helpfiles, they explain this well.

btw- not too sure about the syntax, but you'll manage.

Login to post a reply

Server time is: 2024-11-27 08:51:41
Your offset time is: 2024-11-27 08:51:41