0
0to60
I have to write to a fixed field file, and I have to format my numbers in a
particular way. I have to front pad them with 0's, and I have to write the
decimal value 3.14 as "314". So for example, if its a 8 character field I'd
have to write:
"00000314"
I looked at MS' formatting documentation (IFormatProvider, IFormatable) but
the docs were complicated and I suspect there's a better explanation for me.
Can someone tell me what's the easiest way to go about this? I'll need to
be able to specify the fixed field width and the number of decimal places.
particular way. I have to front pad them with 0's, and I have to write the
decimal value 3.14 as "314". So for example, if its a 8 character field I'd
have to write:
"00000314"
I looked at MS' formatting documentation (IFormatProvider, IFormatable) but
the docs were complicated and I suspect there's a better explanation for me.
Can someone tell me what's the easiest way to go about this? I'll need to
be able to specify the fixed field width and the number of decimal places.