From: jason joo Date: 2010-08-11T10:38:27+09:00 Subject: Re: Hel;p with Tip Calculator --000e0cd3292e3c049d048d824e49 Content-Type: text/plain; charset=ISO-8859-1 or just >> input_string.to_s.gsub(/\D/,'') for number format permitted 2010/8/10 Hassan Schroeder > On Tue, Aug 10, 2010 at 6:51 AM, Hd Pwnz0r > wrote: > > >> input_string.gsub(/\D/, '') > > > tax.rb:6:in `
': undefined method `gsub' for 0:Fixnum > > (NoMethodError) > > > > When using that code. > > Yes, it works on *strings* -- that was the problem you posed. If you > already have a *number*, it's not going to include any symbols like > "$" or "%" in the first place. > > -- > Hassan Schroeder ------------------------ hassan.schroeder@gmail.com > twitter: @hassan > > --000e0cd3292e3c049d048d824e49--