-- 6cD+3sLLzTZuEq3oi1i Content-Type: text/plain Content-Transfer-Encoding: 7bit You're right, I should have asked before using the code. I assumed that any code available as a download off the ruby quiz site was part of the public domain. I choose to use your solution because of it terseness. I haven't found a problem with "ands". Can you give a test case where it fails? I left in the comments because I felt it was ruby to modify your code when I wasn't actually adding any new features. Thanks again for doing the hard work on this plugin. It only took me about 20 minutes to make it a plugin, add another method, and write the README. Now I just have to make myself disciplined enough to write test cdoe! Charlie www.recentramble.com On Wed, 2006-05-10 at 23:38 +0900, Matthew Moss wrote: > On 5/10/06, Charlie Bowman <charlie / castlebranch.com> wrote: > > > > > > The Rails Plugin is a direct result of the ruby quiz. I just wanted to > > say thanks to Ruby Quiz and Mathew Ross for his solution. > > > > > > umbersToWords - convert your integers and floats to english or > > japaneese words,or translate it into american currency > > > > - This plugin was created from a solution to the ruby quiz (english > > numbers) by Matthew D Moss. I modified the code to work as a rails > > plugin and added the to_dollars method. > > - the to_dollars method will work with integers and floats > > - the to_english and to_japaneese methods will only work with integers. > > If you have call these methods on a float, it will be converted to an > > integer before translating. > > > > xamples > > 123.to_english one hundred and twenty-three > > 123.to_japaneese hyaku niju san > > 123.to_dollars one hundred and twenty-three dollars > > money 23.23 > > money.to_dollars one hundred and twenty-three dollars and > > twenty-three cents > > money .01 > > money.to_dollars one dollar and one cent > > > > nstall script/plugin install > > http://svn.recentrambles.com/plugins/numbersToWords > > > > > hank You Ruby Quiz and Matthew D Moss > > Wow... neat! You're welcome. > > > icense > > Ruby's - Do whatever you want whenever you want, with any part or all of > > this code. > > Just fyi for the future... Submitted rubyquiz code isn't > automatically in the public domain nor automatically under any > particular license. I recommend in the future that you ask the author > before using the code and presenting it publicly. > > I don't say this to be a hardass... In particular, with my > submissions, I'm pretty much going to be very lenient and say, "Do > what you like with it." I only say this because potentially there may > be some authors who, for one reason or another, will not want certain > submissions used. > > Enough of that... > > > - This plugin was created from a solution to the ruby quiz (english > > numbers) by Matthew D Moss. I modified the code to work as a rails > > plugin and added the to_dollars method. > > - the to_dollars method will work with integers and floats > > - the to_english and to_japaneese methods will only work with integers. > > If you have call these methods on a float, it will be converted to an > > integer before translating. > > Some minor comments on my code... > > I wasn't particularly happy with the use of "and" in the final > results. It *usually* worked the way I wanted, but not always. > > Also, as noted in the comments, my knowledge of counting in Japanese > is somewhat limited. I think it's correct, but could possibly be > improved. > > Finally, it is funny that some of the joke comments and strings in the > code are still there... Things like "nothingtoseeheremovealong", > "hello world" and this line: > > x ('and' if @conjunction and junction)] # wyf? > > ... which should be familiar to anyone who watched Schoolhouse Rock growing up. > > -- 6cD+3sLLzTZuEq3oi1i--