Craig Dudley wrote:
I'm sure I've seen a CFC or UDF before that translates numbers into
words, eg;
we used to have a c++ cfx tag for that but quite a while ago we switched
to using icu4j's RuleBasedNumberFormat (since we use it for so much
else). besides spellout it also gives you duration
all sounds vaguely familiar. no need of a wrapper class these days, all you
need
is icu4j on the classpath et voilĂ
cfscript
// otherwise default to server lcocale
locale=createObject(java,com.ibm.icu.util.ULocale).init(en_US);
// just for convenience
cfset finalString = formatter.format(javacast(long,
inNumber),%default)
more for the i18n folks (everyone else avert your eyes ;-): after poking around
a bit i can see that the format() method works w/out a wrapper if you pass in
the ruleset name. cool, i've been out-researched ;-) but many
Craig Dudley wrote:
I'm sure I've seen a CFC or UDF before that translates numbers into
words, eg;
we used to have a c++ cfx tag for that but quite a while ago we switched
to using icu4j's RuleBasedNumberFormat (since we use it for so much
else). besides spellout it also gives you duration
Cheers Paul,
I'll have a play with that.
Craig.
-Original Message-
From: Paul Hastings [mailto:[EMAIL PROTECTED]
Sent: 16 November 2005 12:13
To: CF-Talk
Subject: Re: Numbers to Words
Craig Dudley wrote:
I'm sure I've seen a CFC or UDF before that translates numbers into
words, eg
Just incase anyone else is interested in a version of working code...
Copy/Install the icu4j jar file from
http://www-306.ibm.com/software/globalization/icu/downloads.jsp to
CFusionMX/runtime/servers/lib
And then
!--- Create and instance of the formatter using spellout ---
cfset formatter =
http://www.cflib.org/udf.cfm?ID=40
-Original Message-
From: Craig Dudley [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 16, 2005 6:33 AM
To: CF-Talk
Subject: Numbers to Words
I'm sure I've seen a CFC or UDF before that translates numbers into words,
eg;
103 -- One hundred and
http://www.cflib.org/udf.cfm?ID=40
-Original Message-
From: Craig Dudley [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 16, 2005 6:33 AM
To: CF-Talk
Subject: Numbers to Words
I'm sure I've seen a CFC or UDF before that translates numbers into
words, eg;
103 -- One hundred and
, November 16, 2005 6:13 AM
To: CF-Talk
Subject: Re: Numbers to Words
Craig Dudley wrote:
I'm sure I've seen a CFC or UDF before that translates numbers into
words, eg;
we used to have a c++ cfx tag for that but quite a while ago we switched to
using icu4j's RuleBasedNumberFormat (since we use
: Numbers to Words
Craig Dudley wrote:
I'm sure I've seen a CFC or UDF before that translates numbers into
words, eg;
we used to have a c++ cfx tag for that but quite a while ago we switched
to using icu4j's RuleBasedNumberFormat (since we use it for so much
else). besides spellout it also
Craig Dudley wrote:
!--- Format the number as words using the default ruleSet ---
cfset finalString = formatter.format(javacast(long,
inNumber),%default)
hang on. format() works w/out a wrapper? we've always had to use a java
wrapper for format() especially for number formatting. i guess we'd
: Numbers to Words
http://www.cflib.org/udf.cfm?ID=40
-Original Message-
From: Craig Dudley [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 16, 2005 6:33 AM
To: CF-Talk
Subject: Numbers to Words
I'm sure I've seen a CFC or UDF before that translates numbers into
words, eg;
103 -- One
12 matches
Mail list logo