From: Alex DeCaria Date: 2010-04-14T21:06:11+09:00 Subject: Re: Method to groom a string to floating point representation > >> Delete any decimals in an exponent: >> '245e7.6' => '2.45e76' >> > > Where did the dot in between 2 and 4 come from? Am I interpreting the > String > or just cleaning it? This was a typo on my part. It should have read: '245e7.6' => '245e76' > > >> Delete any extra or misplaced + or – signs: >> '+45-68+e+45-' => '4568e+45' >> >> Delete any extra or misplaced ‘e’ or ‘E’ characters (first occurance of >> '+e4.67e-7' => '+4.67e-7' >> >> > Why does the plus in front of 45 in the first one go away, but the plus > in > front of the e in the second one stays? Again, a typo on my part. It should have been: '+45-68+e+45-' => '+4568e+45' > > This is what I have so far, please check and correct any tests that > should > be different > Thank! I'll check the code you gave me and see how it does. --Alex -- Posted via http://www.ruby-forum.com/.