A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

rounding problems



 
 
Thread Tools Display Modes
  #1  
Old September 16th, 2009, 04:52 PM posted to microsoft.public.access.forms
voodoo
external usenet poster
 
Posts: 3
Default rounding problems

I have a calculated field on a form that produces a number with several
decimal places. Access will automatically round up the result to the
nearest tenth.

for example. the calculated field produces: 54.9876543210
access will round up to: 55.0
I want it to display: 54.9

How do I stop Access from rounding this calculated number.

  #2  
Old September 16th, 2009, 05:01 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default rounding problems

Perhaps there's a difference of definition for "rounding".

The standard 'rule' for rounding would turn 54.98... into 55.0, rounded to
the nearest tenth.

If what you want is to discard all decimal places after the tenth, take a
look at the Trunc() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"voodoo" wrote in message
...
I have a calculated field on a form that produces a number with several
decimal places. Access will automatically round up the result to the
nearest tenth.

for example. the calculated field produces: 54.9876543210
access will round up to: 55.0
I want it to display: 54.9

How do I stop Access from rounding this calculated number.



  #3  
Old September 16th, 2009, 05:37 PM posted to microsoft.public.access.forms
voodoo
external usenet poster
 
Posts: 3
Default rounding problems

Thanks Jeff for the timely response,

Yes, I just want Access to truncate the decimals instead of rounding them.
But I can't seem to find the Trunc() function in Access. I went ahead and
tried using it but Access didn't recognize it. Excel has a Trunc function
but Access does not. Go figure! Any other suggestions?




"Jeff Boyce" wrote in message
...
Perhaps there's a difference of definition for "rounding".

The standard 'rule' for rounding would turn 54.98... into 55.0, rounded to
the nearest tenth.

If what you want is to discard all decimal places after the tenth, take a
look at the Trunc() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"voodoo" wrote in message
...
I have a calculated field on a form that produces a number with several
decimal places. Access will automatically round up the result to the
nearest tenth.

for example. the calculated field produces: 54.9876543210
access will round up to: 55.0
I want it to display: 54.9

How do I stop Access from rounding this calculated number.




  #4  
Old September 16th, 2009, 05:48 PM posted to microsoft.public.access.forms
Gina Whipp
external usenet poster
 
Posts: 3,500
Default rounding problems

Voodoo,

I think the Trunc() funstion applies to Excel, maybe SQL. Try this instead:
=Int([YourField]*100)/100

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"voodoo" wrote in message
...
Thanks Jeff for the timely response,

Yes, I just want Access to truncate the decimals instead of rounding them.
But I can't seem to find the Trunc() function in Access. I went ahead and
tried using it but Access didn't recognize it. Excel has a Trunc function
but Access does not. Go figure! Any other suggestions?




"Jeff Boyce" wrote in message
...
Perhaps there's a difference of definition for "rounding".

The standard 'rule' for rounding would turn 54.98... into 55.0, rounded
to the nearest tenth.

If what you want is to discard all decimal places after the tenth, take a
look at the Trunc() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"voodoo" wrote in message
...
I have a calculated field on a form that produces a number with several
decimal places. Access will automatically round up the result to the
nearest tenth.

for example. the calculated field produces: 54.9876543210
access will round up to: 55.0
I want it to display: 54.9

How do I stop Access from rounding this calculated number.






  #5  
Old September 16th, 2009, 06:17 PM posted to microsoft.public.access.forms
voodoo
external usenet poster
 
Posts: 3
Default rounding problems

Thanks Gina,

That seemed to do the trick although I'm not sure why?

To get the number to show only one decimal I did have to change your
equation
from: =Int([YourField]*100)/100
to: =Int([YourField]*10)/10

thanks to both of you for your help, greatly appreciated!

happy programming

"Gina Whipp" wrote in message
...
Voodoo,

I think the Trunc() funstion applies to Excel, maybe SQL. Try this
instead: =Int([YourField]*100)/100

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"voodoo" wrote in message
...
Thanks Jeff for the timely response,

Yes, I just want Access to truncate the decimals instead of rounding
them. But I can't seem to find the Trunc() function in Access. I went
ahead and tried using it but Access didn't recognize it. Excel has a
Trunc function but Access does not. Go figure! Any other suggestions?




"Jeff Boyce" wrote in message
...
Perhaps there's a difference of definition for "rounding".

The standard 'rule' for rounding would turn 54.98... into 55.0, rounded
to the nearest tenth.

If what you want is to discard all decimal places after the tenth, take
a look at the Trunc() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"voodoo" wrote in message
...
I have a calculated field on a form that produces a number with several
decimal places. Access will automatically round up the result to the
nearest tenth.

for example. the calculated field produces: 54.9876543210
access will round up to: 55.0
I want it to display: 54.9

How do I stop Access from rounding this calculated number.






  #6  
Old September 16th, 2009, 06:22 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default rounding problems

I knew I'd seen it somewhere ... g

As another alternative, setting a reference to the Excel object model and
use Excel's Trunc() function in Access.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"Gina Whipp" wrote in message
...
Voodoo,

I think the Trunc() funstion applies to Excel, maybe SQL. Try this
instead: =Int([YourField]*100)/100

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"voodoo" wrote in message
...
Thanks Jeff for the timely response,

Yes, I just want Access to truncate the decimals instead of rounding
them. But I can't seem to find the Trunc() function in Access. I went
ahead and tried using it but Access didn't recognize it. Excel has a
Trunc function but Access does not. Go figure! Any other suggestions?




"Jeff Boyce" wrote in message
...
Perhaps there's a difference of definition for "rounding".

The standard 'rule' for rounding would turn 54.98... into 55.0, rounded
to the nearest tenth.

If what you want is to discard all decimal places after the tenth, take
a look at the Trunc() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"voodoo" wrote in message
...
I have a calculated field on a form that produces a number with several
decimal places. Access will automatically round up the result to the
nearest tenth.

for example. the calculated field produces: 54.9876543210
access will round up to: 55.0
I want it to display: 54.9

How do I stop Access from rounding this calculated number.







  #7  
Old September 16th, 2009, 06:33 PM posted to microsoft.public.access.forms
Gina Whipp
external usenet poster
 
Posts: 3,500
Default rounding problems

Voodoo,

Oops, one extra '0', sorry about that. Somewhere there is a simple
explanation but I don't remember it.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"voodoo" wrote in message
...
Thanks Gina,

That seemed to do the trick although I'm not sure why?

To get the number to show only one decimal I did have to change your
equation
from: =Int([YourField]*100)/100
to: =Int([YourField]*10)/10

thanks to both of you for your help, greatly appreciated!

happy programming

"Gina Whipp" wrote in message
...
Voodoo,

I think the Trunc() funstion applies to Excel, maybe SQL. Try this
instead: =Int([YourField]*100)/100

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

"voodoo" wrote in message
...
Thanks Jeff for the timely response,

Yes, I just want Access to truncate the decimals instead of rounding
them. But I can't seem to find the Trunc() function in Access. I went
ahead and tried using it but Access didn't recognize it. Excel has a
Trunc function but Access does not. Go figure! Any other suggestions?




"Jeff Boyce" wrote in message
...
Perhaps there's a difference of definition for "rounding".

The standard 'rule' for rounding would turn 54.98... into 55.0, rounded
to the nearest tenth.

If what you want is to discard all decimal places after the tenth, take
a look at the Trunc() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"voodoo" wrote in message
...
I have a calculated field on a form that produces a number with several
decimal places. Access will automatically round up the result to the
nearest tenth.

for example. the calculated field produces: 54.9876543210
access will round up to: 55.0
I want it to display: 54.9

How do I stop Access from rounding this calculated number.








  #8  
Old September 16th, 2009, 06:35 PM posted to microsoft.public.access.forms
Gina Whipp
external usenet poster
 
Posts: 3,500
Default rounding problems

Jeff,

Can you help Voodoo out with why this (=Int([YourField]*100)/100) works? I
just don't remember WHY it works.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Jeff Boyce" wrote in message
...
I knew I'd seen it somewhere ... g

As another alternative, setting a reference to the Excel object model and
use Excel's Trunc() function in Access.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"Gina Whipp" wrote in message
...
Voodoo,

I think the Trunc() funstion applies to Excel, maybe SQL. Try this
instead: =Int([YourField]*100)/100

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

"voodoo" wrote in message
...
Thanks Jeff for the timely response,

Yes, I just want Access to truncate the decimals instead of rounding
them. But I can't seem to find the Trunc() function in Access. I went
ahead and tried using it but Access didn't recognize it. Excel has a
Trunc function but Access does not. Go figure! Any other suggestions?




"Jeff Boyce" wrote in message
...
Perhaps there's a difference of definition for "rounding".

The standard 'rule' for rounding would turn 54.98... into 55.0, rounded
to the nearest tenth.

If what you want is to discard all decimal places after the tenth, take
a look at the Trunc() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"voodoo" wrote in message
...
I have a calculated field on a form that produces a number with several
decimal places. Access will automatically round up the result to the
nearest tenth.

for example. the calculated field produces: 54.9876543210
access will round up to: 55.0
I want it to display: 54.9

How do I stop Access from rounding this calculated number.









  #9  
Old September 16th, 2009, 07:49 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default rounding problems

"fraid I can't ... if it needs to be tenths, I don't see how Int() gets
there!

Regards

Jeff Boyce
Microsoft Office/Access MVP


"Gina Whipp" wrote in message
...
Jeff,

Can you help Voodoo out with why this (=Int([YourField]*100)/100) works?
I just don't remember WHY it works.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Jeff Boyce" wrote in message
...
I knew I'd seen it somewhere ... g

As another alternative, setting a reference to the Excel object model and
use Excel's Trunc() function in Access.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"Gina Whipp" wrote in message
...
Voodoo,

I think the Trunc() funstion applies to Excel, maybe SQL. Try this
instead: =Int([YourField]*100)/100

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

"voodoo" wrote in message
...
Thanks Jeff for the timely response,

Yes, I just want Access to truncate the decimals instead of rounding
them. But I can't seem to find the Trunc() function in Access. I went
ahead and tried using it but Access didn't recognize it. Excel has a
Trunc function but Access does not. Go figure! Any other suggestions?




"Jeff Boyce" wrote in message
...
Perhaps there's a difference of definition for "rounding".

The standard 'rule' for rounding would turn 54.98... into 55.0,
rounded to the nearest tenth.

If what you want is to discard all decimal places after the tenth,
take a look at the Trunc() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"voodoo" wrote in message
...
I have a calculated field on a form that produces a number with
several decimal places. Access will automatically round up the result
to the nearest tenth.

for example. the calculated field produces: 54.9876543210
access will round up to: 55.0
I want it to display: 54.9

How do I stop Access from rounding this calculated number.











  #10  
Old September 16th, 2009, 07:57 PM posted to microsoft.public.access.forms
Gina Whipp
external usenet poster
 
Posts: 3,500
Default rounding problems

Someone told me once and it was so simple... HOPEFULLY, they will see this
and provide an answer. Of course, I know what I will be doing tonight!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Jeff Boyce" wrote in message
...
"fraid I can't ... if it needs to be tenths, I don't see how Int() gets
there!

Regards

Jeff Boyce
Microsoft Office/Access MVP


"Gina Whipp" wrote in message
...
Jeff,

Can you help Voodoo out with why this (=Int([YourField]*100)/100) works?
I just don't remember WHY it works.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

"Jeff Boyce" wrote in message
...
I knew I'd seen it somewhere ... g

As another alternative, setting a reference to the Excel object model
and use Excel's Trunc() function in Access.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"Gina Whipp" wrote in message
...
Voodoo,

I think the Trunc() funstion applies to Excel, maybe SQL. Try this
instead: =Int([YourField]*100)/100

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors II

http://www.regina-whipp.com/index_files/TipList.htm

"voodoo" wrote in message
...
Thanks Jeff for the timely response,

Yes, I just want Access to truncate the decimals instead of rounding
them. But I can't seem to find the Trunc() function in Access. I went
ahead and tried using it but Access didn't recognize it. Excel has a
Trunc function but Access does not. Go figure! Any other
suggestions?




"Jeff Boyce" wrote in message
...
Perhaps there's a difference of definition for "rounding".

The standard 'rule' for rounding would turn 54.98... into 55.0,
rounded to the nearest tenth.

If what you want is to discard all decimal places after the tenth,
take a look at the Trunc() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP


"voodoo" wrote in message
...
I have a calculated field on a form that produces a number with
several decimal places. Access will automatically round up the
result to the nearest tenth.

for example. the calculated field produces: 54.9876543210
access will round up to: 55.0
I want it to display: 54.9

How do I stop Access from rounding this calculated number.













 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.