Types of text form fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
Is there a way, in a text form fields options, using the Type "Calculation",
to format the result to round properly. With the regular settings, if the
result is 125.35 it rounds it to 125 (which is ok) but if the result is
125.95 it still rounds it to 125 instead of 126.
Is there a solution for this or I'm asking for too much? :^)
Thanks in advance.
 
It seems as if Word just discards the decimals, instead of rounding
the number properly. :-(

Ask in a programming newsgroup if there is a macro that can solve this
problem.

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
Hi =?Utf-8?B?UnlrYXIy?=,
Is there a way, in a text form fields options, using the Type "Calculation",
to format the result to round properly. With the regular settings, if the
result is 125.35 it rounds it to 125 (which is ok) but if the result is
125.95 it still rounds it to 125 instead of 126.
Is there a solution for this or I'm asking for too much? :^)
In Word, this requires a more complicated calculation. For example:

{ Set Result { = Val1 + Val2 } }{ IF { = Result - Int(Result) } < 50 { =
Int(Result) } Int({ = Result + 1 }) }

Note that I use regular fields (insert field brackets with Ctrl+F9) rather than
a calculation form field.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
 
Stupid question: Why are you comparing to 50 (in the IF field)?
Shouldn't this be 0.5?

--
Stefan Blom
Microsoft Word MVP


in message
 
Hi all,
Thanks for your response. After a while playing with this issue I found that
you can round correctly using the round tool.
Thanks all.
 
Indeed, using the Round function in a field would be a lot easier!

--
Stefan Blom
Microsoft Word MVP


in message
 
Thanks all for your help, much appreciated.

Stefan Blom said:
Indeed, using the Round function in a field would be a lot easier!

--
Stefan Blom
Microsoft Word MVP


in message
 
Actually, you should thank yourself, since you did the job. :-)

--
Stefan Blom
Microsoft Word MVP


in message
 
Hi =?Utf-8?B?UnlrYXIy?=,
Thanks for your response. After a while playing with this issue I found that
you can round correctly using the round tool.
<Duh>I had assumed from your problem description that you'd tried the Round
function and it wasn't working. Apparently, you were just setting the format of
the number to cut off the decimal places?

Cindy Meister
 
Back
Top