The 10 tells the format spec to make the whole field 10 positions long. This includes the decimal point and all leading spaces. The 2 tells it to format for 2 decimals begind the point. As you can see in the example, it also rounds numbers.
This works only when all numbers are formatted for the same amount of decimals after the point. In your case you could make a strings with a high count after the decimal count:
Of course - now I see you do it it looks natural. For some reason I hadn't thought of trying to capture the results of format and continuing to work on them, I've just been using format in print statements.
hoping to strip 0's if not followed by more digits or decimal point. How long did it take for you guys to become blackbelts in RegExp-Do? :-) Takes me an hour per regex...
I only have my yellow belt in regex, so I'm around the same level as you, cormullion.
I remember a quote having to do with someone having a problem that he decided to solve with regular expressions. "Now," as the saying goes, "he has two problems." ;-)