Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Jerye Jerye is offline
external usenet poster
 
Posts: 2
Default How can you round a number in a non-calculating field?

I have a form field that needs to be rounded, but it is not a calculating
form field, it is the field used in the calculation of another form field. Is
there a way to do this?

Jerye
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default How can you round a number in a non-calculating field?

As far as I know, you cannot actually round numbers in a display field, but
you can specify a number format so that Word drops digits that you don't
want to show (for example, all decimals but the first two).

--
Stefan Blom
Microsoft Word MVP



"Jerye" wrote in message
...
I have a form field that needs to be rounded, but it is not a calculating
form field, it is the field used in the calculation of another form field.
Is
there a way to do this?

Jerye



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How can you round a number in a non-calculating field?

Hi Jerye,

You can make a formfield round a number to various levels of precision. If you set the formfield's 'type' property to 'number' you
then get the option to set the precision. That's the precision level the formfield will store, regardless of what's input. If you
need to use a rounded version of that in another formula, you could use a formula field coded as:
.. {=ROUND(Text1,-2)} to round the text formfield's value off to the nearest 100
.. {=ROUND(Text1,0)} to round the text formfield's value off to the nearest whole number
.. {=ROUND(Text1,2)} to round the text formfield's value off to the nearest 1/100
etc, where 'Text1' is the formfield's bookmark name.

--
Cheers
macropod
[Microsoft MVP - Word]


"Jerye" wrote in message ...
I have a form field that needs to be rounded, but it is not a calculating
form field, it is the field used in the calculation of another form field. Is
there a way to do this?

Jerye


  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default How can you round a number in a non-calculating field?

I believe it's been established that Word does actually round numbers when
you set a specific number of digits to display.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Stefan Blom" wrote in message
...
As far as I know, you cannot actually round numbers in a display field,
but you can specify a number format so that Word drops digits that you
don't want to show (for example, all decimals but the first two).

--
Stefan Blom
Microsoft Word MVP



"Jerye" wrote in message
...
I have a form field that needs to be rounded, but it is not a calculating
form field, it is the field used in the calculation of another form
field. Is
there a way to do this?

Jerye





  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default How can you round a number in a non-calculating field?

When I test this (text form field of type "Number," with the format set to
"0.00,"), Word doesn't seem to round the number correctly, if I add
excessive decimals.

--
Stefan Blom
Microsoft Word MVP



"Suzanne S. Barnhill" wrote in message
...
I believe it's been established that Word does actually round numbers when
you set a specific number of digits to display.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Stefan Blom" wrote in message
...
As far as I know, you cannot actually round numbers in a display field,
but you can specify a number format so that Word drops digits that you
don't want to show (for example, all decimals but the first two).

--
Stefan Blom
Microsoft Word MVP



"Jerye" wrote in message
...
I have a form field that needs to be rounded, but it is not a calculating
form field, it is the field used in the calculation of another form
field. Is
there a way to do this?

Jerye










  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default How can you round a number in a non-calculating field?

I guess I'm remembering wrong, then.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Stefan Blom" wrote in message
...
When I test this (text form field of type "Number," with the format set to
"0.00,"), Word doesn't seem to round the number correctly, if I add
excessive decimals.

--
Stefan Blom
Microsoft Word MVP



"Suzanne S. Barnhill" wrote in message
...
I believe it's been established that Word does actually round numbers when
you set a specific number of digits to display.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Stefan Blom" wrote in message
...
As far as I know, you cannot actually round numbers in a display field,
but you can specify a number format so that Word drops digits that you
don't want to show (for example, all decimals but the first two).

--
Stefan Blom
Microsoft Word MVP



"Jerye" wrote in message
...
I have a form field that needs to be rounded, but it is not a
calculating
form field, it is the field used in the calculation of another form
field. Is
there a way to do this?

Jerye








  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Jerye Jerye is offline
external usenet poster
 
Posts: 2
Default How can you round a number in a non-calculating field?

What I am needing is to be able type in 14.9 and it will round to 15 or 14.3
and it will round to 14. Word always rounds down, no matter what. This is not
a calulating form field, so I can't put in a formula.

Jerye

"Jerye" wrote:

I have a form field that needs to be rounded, but it is not a calculating
form field, it is the field used in the calculation of another form field. Is
there a way to do this?

Jerye

  #8   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How can you round a number in a non-calculating field?

Hi jerye,

You can only achieve what you're after with vba. You could for example, use code like:
Option Explicit
Dim FfName As String

Sub GetFF()
FfName = Selection.Bookmarks(1).Name
End Sub

Sub RoundIt()
ActiveDocument.FormFields(FfName).Result = Round(ActiveDocument.FormFields(FfName).Result, 0)
End Sub
in a normal code module and make 'GetFF' the 'On Entry' macro and 'RoundIt' the 'On Exit' for the formfield, which must also have a
bookmark name.

If the formfield is formatted as text, you'll get a result equal to the rounded number, with no decimals. If the formfield is
formatted as number, you'll need to have at least one decimal, and the returned result will be the whole number plus '.0' (or
however many decimals you're using).

Note: If the formfield you're dealing with is the first in the document, you'll also need to use code like the following in the
document's 'This Document' module:

Option Explicit

Private Sub Document_Open()
Call GetFF
End Sub

--
Cheers
macropod
[Microsoft MVP - Word]


"Jerye" wrote in message ...
What I am needing is to be able type in 14.9 and it will round to 15 or 14.3
and it will round to 14. Word always rounds down, no matter what. This is not
a calulating form field, so I can't put in a formula.

Jerye

"Jerye" wrote:

I have a form field that needs to be rounded, but it is not a calculating
form field, it is the field used in the calculation of another form field. Is
there a way to do this?

Jerye


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Round Down Merge field Niall Mailmerge 2 August 19th 13 09:05 PM
Round a form field within a table Loretta Microsoft Word Help 1 April 6th 09 06:13 AM
Calculating the previous month in a date field ram Microsoft Word Help 2 February 17th 08 04:34 AM
Number-only field allows "t" and "h"?! FoiledByOffice Tables 3 June 24th 05 05:29 PM
form field,can I add a telephone number under the number field w/d redwolfe5 Microsoft Word Help 3 March 3rd 05 05:30 PM


All times are GMT +1. The time now is 08:45 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"