generally speaking when you look a number and convert it into text you go through
some simble steps

say we start with this number
123,456,789
first we divide into sets of three
(123,000,000)+(456,000)+(789)
then we expand
(123*1,000,000) + (456*1,000)+(789)
and expand further
(((1*100)+(20+3))*1,000,000) + (((4*100)+(50+6))*1,000)+((7*100)+(80+9))
then we convert to words
(((one*hundred)+(twenty+three))*million)+(((four*hundred)+(fifty+six))*thousand)+((seven*hundred)+(eighty+nine))

now we replace math with spaces except the + between the tens and ones producing

one hundred twenty-three million four hundred fifty-six thousand seven hundred
eighty-nine

each and every one of these steps can easily be done by a very simple fnction
that would call itself every time it has to expand untill the end

now all that is left over is what is after the decimal
this can be done with the 'point one two three' convention or the 'and one
hundred twenty-three hundredth' convention
the first would be as simple as adding ' point' to the end of the string and then
adding each number
the second would add ' and' to the end of the string the sending the number
through the function that did the first part and the adding the correct nth to
the end

both of these methods for dealling with decimalls are both widly used and
accepted and I have never met any one that didn't understand both of them
and as far as I know other speaking languages use systems sinular if not the same
as the one used in english thus the code to to it will iether be the same or
extremly similar.
also while using somthing such as 1800 it technicaly is not mathmatically correct
(or so I've been told by every math teacher I have ever had)

Brian Finney


ps for now I am simply throwing in the ideas if anyone would like I can also toss
in a little code that could accomplish these things


"Bryan C. Warnock" wrote:

> On Fri, 05 Jan 2001, Piers Cawley wrote:
> > But, but... 0.21 is *not* 'point twenty one', it's 'point two one',
> > otherwise you get into weirdness with: .21 and .210 being spoken as
> > 'point twenty one' and 'point two hundred (?:and)? ten' and all of a
> > sudden the '2' in that figure has gained an order of magnitude which
> > is just plain *wrong*.
>
> Then it would be "one eight zero zero point two one."
> Yes, at least the U.S. used to teach that the gratuitous use of "and" was
> wrong - "one thousand eight hundred twenty-one," but the rules have been
> loosened for integer numbers.
>
> One thousand eight hundred twenty-one.
> One thousand eight hundred and twenty-one
> Eighteen hundred and twenty-one.
> One thousand eight hundred and twenty-one hundredths.
> One thousand eight hundred and two million, one hundred thousand ten
> millionths.
>
> How did we get on this subject?  Oh, yes, sorting by the number spelled out...
> That should throw several cultures for a loop.
>
> Four and twenty blackbirds, baked 'e' and 'pi'.
>
> >
> > Ghod knows how this GST would have you pronounce 5.6.0, 'five
> and six
> > and oh'?
>
> The computer kulture has its own rules for written and spoken grammar.
>
> --
> Bryan C. Warnock
> bwarnock@(gtemail.net|capita.com)

Reply via email to