Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Large dollar amount switch
In one of my merge documents, I use the \*DollarText field switch to format
the dollar amount in words. It has worked fine until now, but we just got a dollar amount over $1 million and I'm getting an error because the number is too high. Is there a fix for this? |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Large dollar amount switch
In the U.S. you can probably use
{ SET x { MERGEFIELD mylargenumber } }{ SET r { =MOD(x,1000000) } }{ SET m { =INT(x-r)/1000000)) } }{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext } to go a bit larger. You might need to check the calculations better than I have. But you can modify the technique anyway to separate out each digit and convert it to a word. Peter Jamieson "Todd K." wrote in message ... In one of my merge documents, I use the \*DollarText field switch to format the dollar amount in words. It has worked fine until now, but we just got a dollar amount over $1 million and I'm getting an error because the number is too high. Is there a fix for this? |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Large dollar amount switch
Do I paste all of this into the Mergefield or is this code I have to set up
elsewhere? "Peter Jamieson" wrote: In the U.S. you can probably use { SET x { MERGEFIELD mylargenumber } }{ SET r { =MOD(x,1000000) } }{ SET m { =INT(x-r)/1000000)) } }{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext } to go a bit larger. You might need to check the calculations better than I have. But you can modify the technique anyway to separate out each digit and convert it to a word. Peter Jamieson "Todd K." wrote in message ... In one of my merge documents, I use the \*DollarText field switch to format the dollar amount in words. It has worked fine until now, but we just got a dollar amount over $1 million and I'm getting an error because the number is too high. Is there a fix for this? |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Large dollar amount switch
it would replace whatever merge field codes you are using now in your Word
document. In essence, enter the {} pairs into your document using ctrl-F9. Type everything else in the usual way. Use Alt-F9 to toggle between "field codes" view and "field results" view. Select the field and press F9 to update the results. Peter Jamieson "Todd K." wrote in message ... Do I paste all of this into the Mergefield or is this code I have to set up elsewhere? "Peter Jamieson" wrote: In the U.S. you can probably use { SET x { MERGEFIELD mylargenumber } }{ SET r { =MOD(x,1000000) } }{ SET m { =INT(x-r)/1000000)) } }{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext } to go a bit larger. You might need to check the calculations better than I have. But you can modify the technique anyway to separate out each digit and convert it to a word. Peter Jamieson "Todd K." wrote in message ... In one of my merge documents, I use the \*DollarText field switch to format the dollar amount in words. It has worked fine until now, but we just got a dollar amount over $1 million and I'm getting an error because the number is too high. Is there a fix for this? |
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Large dollar amount switch
I tried it and I'm getting a result of 0.0, but I noticed two inconsistencies
in your code: 1) you have one too many right brackets "}" 2) on your "SET m" line, there are two closing brackets without opening brackets "))" "Peter Jamieson" wrote: it would replace whatever merge field codes you are using now in your Word document. In essence, enter the {} pairs into your document using ctrl-F9. Type everything else in the usual way. Use Alt-F9 to toggle between "field codes" view and "field results" view. Select the field and press F9 to update the results. Peter Jamieson "Todd K." wrote in message ... Do I paste all of this into the Mergefield or is this code I have to set up elsewhere? "Peter Jamieson" wrote: In the U.S. you can probably use { SET x { MERGEFIELD mylargenumber } }{ SET r { =MOD(x,1000000) } }{ SET m { =INT(x-r)/1000000)) } }{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext } to go a bit larger. You might need to check the calculations better than I have. But you can modify the technique anyway to separate out each digit and convert it to a word. Peter Jamieson "Todd K." wrote in message ... In one of my merge documents, I use the \*DollarText field switch to format the dollar amount in words. It has worked fine until now, but we just got a dollar amount over $1 million and I'm getting an error because the number is too high. Is there a fix for this? |
#6
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Large dollar amount switch
The correct field construction is:
{ SET x { MERGEFIELD mylargenumber }}{ SET r { =MOD(x,1000000) }} { SET m { =INT((x-r)/1000000) }} { IF { m } = 0 "" "{ m \*Cardtext } million "}{ r \Cardtext } -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Todd K." wrote in message ... I tried it and I'm getting a result of 0.0, but I noticed two inconsistencies in your code: 1) you have one too many right brackets "}" 2) on your "SET m" line, there are two closing brackets without opening brackets "))" "Peter Jamieson" wrote: it would replace whatever merge field codes you are using now in your Word document. In essence, enter the {} pairs into your document using ctrl-F9. Type everything else in the usual way. Use Alt-F9 to toggle between "field codes" view and "field results" view. Select the field and press F9 to update the results. Peter Jamieson "Todd K." wrote in message ... Do I paste all of this into the Mergefield or is this code I have to set up elsewhere? "Peter Jamieson" wrote: In the U.S. you can probably use { SET x { MERGEFIELD mylargenumber } }{ SET r { =MOD(x,1000000) } }{ SET m { =INT(x-r)/1000000)) } }{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext } to go a bit larger. You might need to check the calculations better than I have. But you can modify the technique anyway to separate out each digit and convert it to a word. Peter Jamieson "Todd K." wrote in message ... In one of my merge documents, I use the \*DollarText field switch to format the dollar amount in words. It has worked fine until now, but we just got a dollar amount over $1 million and I'm getting an error because the number is too high. Is there a fix for this? |
#7
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Large dollar amount switch
Yes, there should also be a * before the second "Cardtext". Try:
{ SET x { MERGEFIELD mylargenumber } }{ SET r { =MOD(x,1000000) } }{ SET m { =INT((x-r)/1000000)) } }{ IF { m } = 0 "" "{ m \*Cardtext } million " }{ r \*Cardtext } Other than that, it seems OK here - what values do you have in your "mylargenumber" ? What is the result of { x } ? Peter Jamieson "Todd K." wrote in message ... I tried it and I'm getting a result of 0.0, but I noticed two inconsistencies in your code: 1) you have one too many right brackets "}" 2) on your "SET m" line, there are two closing brackets without opening brackets "))" "Peter Jamieson" wrote: it would replace whatever merge field codes you are using now in your Word document. In essence, enter the {} pairs into your document using ctrl-F9. Type everything else in the usual way. Use Alt-F9 to toggle between "field codes" view and "field results" view. Select the field and press F9 to update the results. Peter Jamieson "Todd K." wrote in message ... Do I paste all of this into the Mergefield or is this code I have to set up elsewhere? "Peter Jamieson" wrote: In the U.S. you can probably use { SET x { MERGEFIELD mylargenumber } }{ SET r { =MOD(x,1000000) } }{ SET m { =INT(x-r)/1000000)) } }{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext } to go a bit larger. You might need to check the calculations better than I have. But you can modify the technique anyway to separate out each digit and convert it to a word. Peter Jamieson "Todd K." wrote in message ... In one of my merge documents, I use the \*DollarText field switch to format the dollar amount in words. It has worked fine until now, but we just got a dollar amount over $1 million and I'm getting an error because the number is too high. Is there a fix for this? |
#8
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Large dollar amount switch
It is very easy to make minor mistakes in transposing fields to text strings
but what I suspect Peter really meant was { SET x { Mergefield MyLargeNumber } }{ SET r { =MOD(x,1000000) } }{ SET m { =INT((x-r)/1000000) } }{ IF{ m } = 0 "{=INT({ r })\*Cardtext }" "{ =INT({ m }) \*Cardtext } million " } This works for me (for integers). To aid the copying of field construction to text use the macro at http://www.gmayor.com/export_field.htm. That way you don't get the mistakes If you have decimals with the numbers (or these are currency amounts) then further calculations will be required.- see the section formatting cash amounts in words at http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Todd K. wrote: I tried it and I'm getting a result of 0.0, but I noticed two inconsistencies in your code: 1) you have one too many right brackets "}" 2) on your "SET m" line, there are two closing brackets without opening brackets "))" "Peter Jamieson" wrote: it would replace whatever merge field codes you are using now in your Word document. In essence, enter the {} pairs into your document using ctrl-F9. Type everything else in the usual way. Use Alt-F9 to toggle between "field codes" view and "field results" view. Select the field and press F9 to update the results. Peter Jamieson "Todd K." wrote in message ... Do I paste all of this into the Mergefield or is this code I have to set up elsewhere? "Peter Jamieson" wrote: In the U.S. you can probably use { SET x { MERGEFIELD mylargenumber } }{ SET r { =MOD(x,1000000) } }{ SET m { =INT(x-r)/1000000)) } }{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext } to go a bit larger. You might need to check the calculations better than I have. But you can modify the technique anyway to separate out each digit and convert it to a word. Peter Jamieson "Todd K." wrote in message ... In one of my merge documents, I use the \*DollarText field switch to format the dollar amount in words. It has worked fine until now, but we just got a dollar amount over $1 million and I'm getting an error because the number is too high. Is there a fix for this? |
#9
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Large dollar amount switch
Wow, thank you all so much. I actually made a couple of other changes, as
this is for dollars and needed to be in all capitals, so my final code looks like this: { SET x { MERGEFIELD mylargenumber } }{ SET r { =MOD(x,1000000) } }{ SET m { =INT((x-r)/1000000) } }{ IF { m } = 0 "" "{ m \*Cardtext\*Upper } MILLION" }{ r \*Dollartext\*Upper } But it works great. Kudos to you. "Peter Jamieson" wrote: Yes, there should also be a * before the second "Cardtext". Try: { SET x { MERGEFIELD mylargenumber } }{ SET r { =MOD(x,1000000) } }{ SET m { =INT((x-r)/1000000)) } }{ IF { m } = 0 "" "{ m \*Cardtext } million " }{ r \*Cardtext } Other than that, it seems OK here - what values do you have in your "mylargenumber" ? What is the result of { x } ? Peter Jamieson "Todd K." wrote in message ... I tried it and I'm getting a result of 0.0, but I noticed two inconsistencies in your code: 1) you have one too many right brackets "}" 2) on your "SET m" line, there are two closing brackets without opening brackets "))" "Peter Jamieson" wrote: it would replace whatever merge field codes you are using now in your Word document. In essence, enter the {} pairs into your document using ctrl-F9. Type everything else in the usual way. Use Alt-F9 to toggle between "field codes" view and "field results" view. Select the field and press F9 to update the results. Peter Jamieson "Todd K." wrote in message ... Do I paste all of this into the Mergefield or is this code I have to set up elsewhere? "Peter Jamieson" wrote: In the U.S. you can probably use { SET x { MERGEFIELD mylargenumber } }{ SET r { =MOD(x,1000000) } }{ SET m { =INT(x-r)/1000000)) } }{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext } to go a bit larger. You might need to check the calculations better than I have. But you can modify the technique anyway to separate out each digit and convert it to a word. Peter Jamieson "Todd K." wrote in message ... In one of my merge documents, I use the \*DollarText field switch to format the dollar amount in words. It has worked fine until now, but we just got a dollar amount over $1 million and I'm getting an error because the number is too high. Is there a fix for this? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
right justify dollar amounts | Mailmerge | |||
Dollar Amount Conversion | Microsoft Word Help | |||
Dollar sign | Microsoft Word Help | |||
Method for displaying dollar amount as written on bank check | Microsoft Word Help | |||
dollar symbols | Microsoft Word Help |