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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|