Jerry Fike

Jerry Fike

  • NA
  • 107
  • 0

Padding String Data

Nov 12 2019 12:41 PM
I have an array of strings that have been generated with "e.ToString("f8")" -- e  being a double.  The non-decimal part of e can range from 1 to 8 digits, so it could be 0.00000001 to 99999999.99999999.  Is there an easy way to pad the non-decimal part with spaces when I convert e to a string?
 
I can do it with a lot of rather difficult code (at least for me) but thought I might be missing an easier way.  The goal is to get the results to line up in columns on the decimal points.

Answers (1)