81.666 convert to 81.2?

B

_Bigred

I have a report in Access 2000 for baseball stats.

How do I go about putting a unbound text box on my report that would do the
following:

If the InningsPitched field on the report contains 81.666 the unbound box
would display 81.2 instead.

I would like to do this so the report reflect the appropriate format to
display InningsPitched.

The database contains a few thousand pitchers so I would like to just use
the unbound box.

TIA,
_Bigred
 
D

Duane Hookom

What have you tried so far?
The Int() function will return the integer part of the innings value.
Subtracting the integer part of the innings from the total innings value
will return the percent of an inning.
Multiplying the percent/part of an inning by 3 should return a number that
can be rounded to the number of outs.
 
B

_Bigred

Had not tried anything Duane, because I really didn't know which way
approach the issue.

I will try your suggestion, and see what happens.
_Bigred
 
T

Tom Lake

How do I go about putting a unbound text box on my report that would do
the following:

If the InningsPitched field on the report contains 81.666 the unbound box
would display 81.2 instead.

Why not just create a field with Record Source being InningsPitched and in
its Properties, set the Decimal Places to 1?

Tom Lake
 
M

MA

_Bigred said:
I have a report in Access 2000 for baseball stats.

How do I go about putting a unbound text box on my report that would
do the following:

If the InningsPitched field on the report contains 81.666 the unbound
box would display 81.2 instead.

I would like to do this so the report reflect the appropriate format
to display InningsPitched.

The database contains a few thousand pitchers so I would like to just
use the unbound box.

TIA,
_Bigred

Hi,
Function fctRound(varNr As Variant, Optional varPl As Integer = 2) As Double
'by Konrad Marfurt + ("" by) Luke Chung + Karl Donaubauer

'esce se valore non numerico
If Not IsNumeric(varNr) Then Exit Function

fctRound = Fix("" & varNr * (10 ^ varPl) + Sgn(varNr) * 0.5) / (10 ^
varPl)

End Function

In your case
=fctround([youtextbox];1)


--
_ _
Ciao
MAssimiliano Amendola www.accessgroup.it
Cisa1 - I° Conferenza Italiana per Sviluppatori Access Arezzo 4+5
Giugno 2005 Info: www.donkarl.com/it
 
D

Duane Hookom

When I am unsure of which way to approach an issue, I would try a few things
and maybe take a chance with Help. If I didn't find the complete solution, I
would post a question with:
-my challenge
-what I tried
-what my results were
-where I still need assistance
 
M

Mike Painter

_Bigred said:
I have a report in Access 2000 for baseball stats.

How do I go about putting a unbound text box on my report that would
do the following:

If the InningsPitched field on the report contains 81.666 the unbound
box would display 81.2 instead.

I would like to do this so the report reflect the appropriate format
to display InningsPitched.

The database contains a few thousand pitchers so I would like to just
use the unbound box.
Maybe this is a baseball thing but .666 would truncate to .6 and round to .7
Where does the 2 come in? if it's the 2 from 2/3 then you need to look at
the mod function.
 
S

Steven Greenberg

Maybe this is a baseball thing but .666 would truncate to .6 and round
to .7 Where does the 2 come in? if it's the 2 from 2/3 then you need
to look at the mod function.

in baseball stats that decimal does represent the number of outs the
pitcher gets: .1 = one out and .2 = two outs. obviously .3 would represent
all three outs therefore would get a whole number added. I would just test
the two possible values of .333 and .666 since that is the only possible
values it could take.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top