in reply to Doing multiple search and replace operations on a string

We would really need to see a data sample to know and figure out. In general, using regexes for manipulating numbers is not a very good idea (except of course just picking up the number in a string), but there can be many exceptions, especially when reading from a file. In general, if the numbers can be read as a number by Perl straight out of the box, you probably want to let Perl convert it into a number and then apply your sprintf format to all of them. But, then, again, there can be exceptions, so please show a smple of your data.

Update: Hum, just reading your post again just immediately after having posted, I realize that I had not understood that your letters referred to the metric system prefixes. Forget what I wrote above, it is most probably irrelevant to your problem. Sorry for having misread your problem.

  • Comment on Re: Doing multiple search and replace operations on a string