This rounds to however many decimal places you want:

Public Function round(amt as variant, no_dp as integer)
Dim multiplier As Long
multiplier = 10 ^ no_dp
round = (Int((multiplier * amt) + 0.5)) / multiplier
End Function


Jane

--- In [email protected], "Toby Bierly" <[EMAIL PROTECTED]> 
wrote:
>
> ' Rounds amt argument to an integer
> Function Round(amt) As Integer
>     Round = Int(amt + 0.5)
> End Function
> 
> HTH,
> Toby
> 
> ----- Original Message ----- 
> From: "rajeev vasu" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Monday, October 10, 2005 6:31 PM
> Subject: Re: [AccessDevelopers] Store number to 2 decimal places
> 
> 
> > How can we do it no decimel at all?
> >
> > - Rajeev
> >
> >
> > --- Toby Bierly <[EMAIL PROTECTED]> wrote:
> >
> >
> > ---------------------------------
> > Do you need to actually round before storing the data,
> > or can you round at
> > the point of exporting to an accounting system?
> >
> > Also, you can building your own rounding function
> > using the Int function.
> > For example
> >
> > ' Rounds amt argument to two decimals
> > Function Round2Dec(amt) As Double
> >     Round2Dec = (Int((100 * amt) + 0.5)) / 100
> > End Function
> >
> > HTH,
> > Toby
> >
> > ----- Original Message ----- 
> > From: "angusnisbet" <[EMAIL PROTECTED]>
> > To: <[email protected]>
> > Sent: Monday, October 10, 2005 3:26 PM
> > Subject: [AccessDevelopers] Store number to 2 decimal
> > places
> >
> >
> > > I have built a number of databases, generally for
> > various financial
> > > purposes, and there is a recurring problem which
> > perhaps some of you
> > > can help me with.
> > >
> > > How can I store numbers to a maximum of two decimal
> > places?   This can
> > > have serious consequences when exporting data to an
> > accounting system.
> > >
> > > The various Number data type settings deal solely
> > with how it is
> > > displayed, not how it is stored, likewise the
> > Currency data type.
> > > The Input mask does not seem to do a satisfactory
> > job and besides many
> > > of the values are calculated.   Why isn't there a
> > Round() function?
> > >
> > > Thanks for any help.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Please zip all files prior to uploading to Files
> > section.
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> > Please zip all files prior to uploading to Files
> > section.
> >
> >
> >
> >       SPONSORED LINKS
> >
> > Microsoft access developer
> >        Microsoft access help
> >          Microsoft access database
> >                                            Microsoft
> > access training
> > Microsoft access training course
> >              Microsoft access programming
> >
> >
> > ---------------------------------
> >   YAHOO! GROUPS LINKS
> >
> >
> >     Visit your group "AccessDevelopers" on the web.
> >
> >     To unsubscribe from this group, send an email to:
> >  [EMAIL PROTECTED]
> >
> >     Your use of Yahoo! Groups is subject to the Yahoo!
> > Terms of Service.
> >
> >
> > ---------------------------------
> >
> >
> >
> >
> >
> >
> > __________________________________________________________
> > Yahoo! India Matrimony: Find your partner now. Go to
> http://yahoo.shaadi.com
> >
> >
> >
> >
> > Please zip all files prior to uploading to Files section.
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/q7folB/TM
--------------------------------------------------------------------~-> 


Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessDevelopers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




Reply via email to