![]() |
|
#1
|
|||
|
|||
|
How could I convert Currency in to words without VBA.... I want achieve this with a formula....
Amount Field Name: PAYMENTVALUETOTAL Like this, "$1,000.23", I need it like "One thousand dollars and twenty three cents" how could I achieve this via formula... Thanks, Naveen |
|
#2
|
||||
|
||||
|
For that you could use a field constructed as:
Code:
{QUOTE{SET Val «PAYMENTVALUETOTAL»}↵
{IF{=INT(Val/100000000)}<> 0 "{=INT(Val/100000000) \*Cardtext} hundred "}↵
{IF{=MOD(INT(Val/1000000),100)}<> 0 "{IF{=MOD(INT(Val/100000000),10)}<> 0 "and "}"}↵
{IF{=INT(Val/100000)}<> 0 "{=MOD(INT(Val/1000000),100) \*Cardtext} million{IF{=MOD(INT(Val/1000),10)}<> 0 ","} "}↵
{IF{=MOD(INT(Val/100000),10)}<> 0 "{=MOD(INT(Val/100000),10) \*Cardtext} hundred "}↵
{IF{=MOD(INT(Val/1000),100)}<> 0 "{IF{=MOD(INT(Val/100000),10)}<> 0 "and "}" {IF{=MOD(INT(Val/1000),10)}<> 0 "thousand{IF{=MOD(INT(Val/1000),10)}= 0 "," }} "}↵
{IF{=MOD(INT(Val/1000),10)}<> 0 "{=MOD(INT(Val/1000),100) \*Cardtext} thousand{IF{= MOD(INT(Val/100),10)}<> 0 ","} "}↵
{IF{=MOD(INT(Val/100),10)}<> 0 "{=MOD(INT(Val/100),10) \*Cardtext} hundred "}↵
{IF{=MOD(INT(Val),100)}<> 0 "{IF{=INT(Val/100)}<> 0 "and "}{=MOD(INT(Val),100) \*Cardtext} "}↵
{=INT(Val) \# \dollar}{IF{=INT(Val)}<> 0 "s"}↵
" and {=MOD(Val,1)*100 \*Cardtext} cent{IF{=MOD(Val,1)}<> 0.01 s}" \* FirstCap}
Mailmerge Tips & Tricks
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#3
|
|||
|
|||
|
I had done exactly same as you had suggested but getting error
"Minus Error! Unknown op code for conditional.Error! Unknown op code for conditional.six thousand, zero hundred zerodollars" Thanks, Naveen |
|
#4
|
||||
|
||||
|
That tells me you haven't matched exactly the field coding I posted. The error could be as simple as the omission of a space character.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mergefield - Replace Prefix of Document Number | boonlailee | Mail Merge | 13 | 06-13-2019 04:38 PM |
Word MergeField Code Text issue
|
stevenel | Mail Merge | 17 | 09-27-2018 09:12 PM |
Printing selected pages based on a MERGEFIELD.g. If MERGEFIELD=x then print pages 1,2,4 if MERGEFIEL
|
Richard.p | Word | 3 | 04-21-2015 01:14 AM |
| Omit mergefield if it contains specific text | MikeStewart | Mail Merge | 3 | 10-01-2014 01:31 AM |
IF statement just generates text "MERGEFIELD" in document - what am I doing wrong?
|
Eri | Mail Merge | 1 | 03-03-2012 03:03 PM |