You may try this using CF_REextract
(see
http://www.contentbox.com/claude/customtags/REextract/testREextract.cfm )
This few lines will do the trick:
<CFSET string = " fifty-six thousand two hundred thirty-one dollars and
17/100">
<CF_REExtract INPUTMODE="variable"
INPUT="string"
OUTPUTMODE="query"
RE1="[^-](one|two|three|four|five|six|seven|eight|nine|ten|twenty|thirty|fourty|fifty|sixty|seventy|eighty|ninety)"
RE2="">
<CFLOOP QUERY="REExtract">
<CFSET string = RemoveChars(string, REExtract.pos1+1, 1)>
<CFSET string = insert(ucase(mid(REExtract.string1, 2, 1)), string,
REExtract.pos1)>
</CFLOOP>
<CFOUTPUT><P>string = "#string#"</CFOUTPUT>
The output is:
" Fifty-six thousand Two hundred Thirty-one dollars and 17/100"
(you just have to add a space at the beging of the string to facilitate
the process, then remove it)
--
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:21:936
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/21
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:21
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54