PC Review


Reply
Thread Tools Rate Thread

Always Round Down

 
 
Nigel
Guest
Posts: n/a
 
      9th Jul 2008
I have a field on a report that whne it prints if it is 3 decimal places ie
36.175 I want it to round down to 36.17, if it is 2 or less decimla places
remain at that value,

any suggestions

field name is tipsize


thanks

 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      9th Jul 2008
See:
http://allenbrowne.com/round.html#RoundDown

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Nigel" <(E-Mail Removed)> wrote in message
news:91BE6C86-93F4-4B7C-8696-(E-Mail Removed)...
>I have a field on a report that whne it prints if it is 3 decimal places ie
> 36.175 I want it to round down to 36.17, if it is 2 or less decimla places
> remain at that value,
>
> any suggestions
>
> field name is tipsize


 
Reply With Quote
 
Nigel
Guest
Posts: n/a
 
      9th Jul 2008
error message is


compile error

expected identifier and it highlights the int word

Int(100 * [Reports![Work Order]!wodetail.Report!tipsize]) / 100


"Allen Browne" wrote:

> See:
> http://allenbrowne.com/round.html#RoundDown
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Nigel" <(E-Mail Removed)> wrote in message
> news:91BE6C86-93F4-4B7C-8696-(E-Mail Removed)...
> >I have a field on a report that whne it prints if it is 3 decimal places ie
> > 36.175 I want it to round down to 36.17, if it is 2 or less decimla places
> > remain at that value,
> >
> > any suggestions
> >
> > field name is tipsize

>
>

 
Reply With Quote
 
Nigel
Guest
Posts: n/a
 
      9th Jul 2008
forget it sometimes I am too stupid for my own good


"Allen Browne" wrote:

> See:
> http://allenbrowne.com/round.html#RoundDown
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Nigel" <(E-Mail Removed)> wrote in message
> news:91BE6C86-93F4-4B7C-8696-(E-Mail Removed)...
> >I have a field on a report that whne it prints if it is 3 decimal places ie
> > 36.175 I want it to round down to 36.17, if it is 2 or less decimla places
> > remain at that value,
> >
> > any suggestions
> >
> > field name is tipsize

>
>

 
Reply With Quote
 
Nigel
Guest
Posts: n/a
 
      9th Jul 2008

but this one I am stuck with

Reports![Work Order]!wodetail.Report!tipsize = Int(100 * Reports![Work
Order]!wodetail.Report!tipsize) / 100


tells me I can't assign a value to this object



"Allen Browne" wrote:

> See:
> http://allenbrowne.com/round.html#RoundDown
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Nigel" <(E-Mail Removed)> wrote in message
> news:91BE6C86-93F4-4B7C-8696-(E-Mail Removed)...
> >I have a field on a report that whne it prints if it is 3 decimal places ie
> > 36.175 I want it to round down to 36.17, if it is 2 or less decimla places
> > remain at that value,
> >
> > any suggestions
> >
> > field name is tipsize

>
>

 
Reply With Quote
 
BruceM
Guest
Posts: n/a
 
      9th Jul 2008
I was going to recommend something of the sort, but I tested first and
discovered what may be some floating point difficulties. For instance, I
type this into the immediate window:
?Int(100 * 3.76 / 100
but it returns 3.75. If I use 3.75 or 3.77 I get the correct result. 7.1
returns 7.09. It seems to work correctly in all cases for three decimal
places. I mention this because the OP wants the value to remain as it is if
there are two decimal places or less.
If this is a currency field, I don't think there is a problem. If it is a
single or double, some workaround seems to be needed. I have discovered
that formatting the value as currency works, as does adding .001 to the
value. There may be other approaches that work better.

"Allen Browne" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> See:
> http://allenbrowne.com/round.html#RoundDown
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Nigel" <(E-Mail Removed)> wrote in message
> news:91BE6C86-93F4-4B7C-8696-(E-Mail Removed)...
>>I have a field on a report that whne it prints if it is 3 decimal places
>>ie
>> 36.175 I want it to round down to 36.17, if it is 2 or less decimla
>> places
>> remain at that value,
>>
>> any suggestions
>>
>> field name is tipsize

>


 
Reply With Quote
 
BruceM
Guest
Posts: n/a
 
      9th Jul 2008
I just realized that if the field is tipsize it is probably currency.

"Allen Browne" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> See:
> http://allenbrowne.com/round.html#RoundDown
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Nigel" <(E-Mail Removed)> wrote in message
> news:91BE6C86-93F4-4B7C-8696-(E-Mail Removed)...
>>I have a field on a report that whne it prints if it is 3 decimal places
>>ie
>> 36.175 I want it to round down to 36.17, if it is 2 or less decimla
>> places
>> remain at that value,
>>
>> any suggestions
>>
>> field name is tipsize

>


 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      9th Jul 2008
No code needed.

Just add a text box with Control Source:
= Int(100 * [tipsize]) / 100

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Nigel" <(E-Mail Removed)> wrote in message
news:9C721B06-AC4F-425B-8760-(E-Mail Removed)...
>
> but this one I am stuck with
>
> Reports![Work Order]!wodetail.Report!tipsize = Int(100 * Reports![Work
> Order]!wodetail.Report!tipsize) / 100
>
> tells me I can't assign a value to this object
>> See:
>> http://allenbrowne.com/round.html#RoundDown

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Round button from round image Amb k Microsoft Dot NET Framework Forms 2 4th Dec 2007 09:25 AM
VS2005 - Going round and round in circles again :) postings@alexshirley.com Microsoft ASP .NET 0 22nd Jun 2006 01:26 PM
How do I ROUND() round off decimals of a column dataset? =?Utf-8?B?SMO4anJ1cA==?= Microsoft Excel Worksheet Functions 1 12th Jan 2005 09:41 AM
Math.Round and SQL Server Round =?Utf-8?B?dG1laXN0ZXI=?= Microsoft VB .NET 5 29th Nov 2004 10:55 PM
Re: math.round vs Excel Round mikeb Microsoft Dot NET Framework 0 20th Jan 2004 01:30 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:21 PM.