in reply to convert last digit in decimal

What have you tried?

You could separate the decimal from the multiplier using a regular expression, use a hash (that maps "M" to 1e6 and "B" to 1e9), multiply the decimal by the multiplier and finally insert into the database.

Replies are listed 'Best First'.
Re^2: convert last digit in decimal
by baperl (Sexton) on Aug 10, 2011 at 20:52 UTC
    thanks for your suggestion AR, I will try it. I was trying to get the length, and then determine the last character, but that was not working out.

      You could also chop and save the last character if you know that the format is always going to be the same. That's a bit simpler than a regex, but it presumes you know the format is constant.

        that's what I did :-)