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 Word » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Format text field as number with +/-



 
 
Thread Tools Display Modes
  #1  
Old April 26th, 2010, 05:30 PM posted to microsoft.public.word.docmanagement
Horatio J. Bilge, Jr.[_2_]
external usenet poster
 
Posts: 152
Default Format text field as number with +/-

I am using Word 2007. I inserted a text form field, using the legacy forms
controls. Under properties for that field, I formatted it as Type: Number,
and Number Format: 0.0

I want the field to display the number with the +/- sign (e.g., if I enter
"1.5" it displays as "+1.5", and if I enter "-1.5" it displays as "-1.5").
Zero should be displayed as "0.0"

I found information about using switches on Graham Mayor's site, but I
couldn't get the switch to work as expected. This is what I tried: { FORMTEXT
\# +0.0 }

Thanks for any help,
~ Horatio

  #2  
Old April 27th, 2010, 06:52 AM posted to microsoft.public.word.docmanagement
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Format text field as number with +/-

The simplest method is to add a Word field immediately before the form field
e.g if the form field is Text1
{ IF{ REF Text1 } 0 "+" }
Check the calculate on exit check box of the form field.and set the number
format property to 0.0

If you enter 0 you will see 0.0. If you enter 1 the Word fielf will display
+ in front of 1.0. If you enter -1 the formfield will display -1.0

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"Horatio J. Bilge, Jr." wrote in
message ...
I am using Word 2007. I inserted a text form field, using the legacy forms
controls. Under properties for that field, I formatted it as Type: Number,
and Number Format: 0.0

I want the field to display the number with the +/- sign (e.g., if I
enter
"1.5" it displays as "+1.5", and if I enter "-1.5" it displays as "-1.5").
Zero should be displayed as "0.0"

I found information about using switches on Graham Mayor's site, but I
couldn't get the switch to work as expected. This is what I tried: {
FORMTEXT
\# +0.0 }

Thanks for any help,
~ Horatio



  #3  
Old April 28th, 2010, 03:22 PM posted to microsoft.public.word.docmanagement
Horatio J. Bilge, Jr.[_2_]
external usenet poster
 
Posts: 152
Default Format text field as number with +/-

Thank you for the advice. After playing with it and reading some more, I
added a "result if false" to your suggestion:
{ IF{ REF Text1 } 0 "+" " " }
With that adjustment, if I change the value in Text1, the +/- sign updates
to match.

Thanks for the help!
~ Horatio

"Graham Mayor" wrote:

The simplest method is to add a Word field immediately before the form field
e.g if the form field is Text1
{ IF{ REF Text1 } 0 "+" }
Check the calculate on exit check box of the form field.and set the number
format property to 0.0

If you enter 0 you will see 0.0. If you enter 1 the Word fielf will display
+ in front of 1.0. If you enter -1 the formfield will display -1.0

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"Horatio J. Bilge, Jr." wrote in
message ...
I am using Word 2007. I inserted a text form field, using the legacy forms
controls. Under properties for that field, I formatted it as Type: Number,
and Number Format: 0.0

I want the field to display the number with the +/- sign (e.g., if I
enter
"1.5" it displays as "+1.5", and if I enter "-1.5" it displays as "-1.5").
Zero should be displayed as "0.0"

I found information about using switches on Graham Mayor's site, but I
couldn't get the switch to work as expected. This is what I tried: {
FORMTEXT
\# +0.0 }

Thanks for any help,
~ Horatio



.

  #4  
Old April 29th, 2010, 05:56 AM posted to microsoft.public.word.docmanagement
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Format text field as number with +/-

There should be no need to add a 'result if false' option if the result if
false is nothing. The field will default to nothing if the condition is not
met.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org





"Horatio J. Bilge, Jr." wrote in
message ...
Thank you for the advice. After playing with it and reading some more, I
added a "result if false" to your suggestion:
{ IF{ REF Text1 } 0 "+" " " }
With that adjustment, if I change the value in Text1, the +/- sign updates
to match.

Thanks for the help!
~ Horatio

"Graham Mayor" wrote:

The simplest method is to add a Word field immediately before the form
field
e.g if the form field is Text1
{ IF{ REF Text1 } 0 "+" }
Check the calculate on exit check box of the form field.and set the
number
format property to 0.0

If you enter 0 you will see 0.0. If you enter 1 the Word fielf will
display
+ in front of 1.0. If you enter -1 the formfield will display -1.0

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"Horatio J. Bilge, Jr." wrote
in
message ...
I am using Word 2007. I inserted a text form field, using the legacy
forms
controls. Under properties for that field, I formatted it as Type:
Number,
and Number Format: 0.0

I want the field to display the number with the +/- sign (e.g., if I
enter
"1.5" it displays as "+1.5", and if I enter "-1.5" it displays as
"-1.5").
Zero should be displayed as "0.0"

I found information about using switches on Graham Mayor's site, but I
couldn't get the switch to work as expected. This is what I tried: {
FORMTEXT
\# +0.0 }

Thanks for any help,
~ Horatio



.



 




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 07:05 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.