From: Jose francisco Gonzalez carmona Date: 2007-11-07T00:31:09+09:00 Subject: Re: convert a string into a decimal Ernst Tanaka wrote: > I am a new Ruby programmer. I am really amazed with the ease of > programming. > > I seem not to be able to find a solution for the following task. > > I want to convert an object with the class string into a object with the > class fixnum or decimal. So I can store the result in a Decimal(13,2) > sql field. > > > The value of the object string is "100,000,000.00" (including the comma > and the decimal point. > > Appreciate all the help at for hand! > > Ernst irb(main):005:0> "100,000,000.00".gsub(',','_').to_f => 100000000.0 -- Posted via http://www.ruby-forum.com/.