giftcards / FixedWidth

Library for working with fixed width files as well as their associated specs
MIT License
10 stars 4 forks source link

Added trim support #5

Closed clphillips closed 9 years ago

clphillips commented 9 years ago

Fixes #2. I would have replaced SprintfValueFormatter instead, but that would result in BC issues.

clphillips commented 9 years ago

Just realized better naming convention might have been SprintfValueTrimFormatter.

yjv commented 9 years ago

I'm thinking that not trimming is a bug so im up for changing the actual SprintfValueFormatter. what bc issue other than untrimmed values is the worry? or do you think that's an issue? also im thinking it would make sense to trim before any of the casting since that better mirrors what happens in the other direction.

yjv commented 9 years ago

looks like the commits on here were in another pr that got merged

clphillips commented 9 years ago

what bc issue other than untrimmed values is the worry? or do you think that's an issue?

I was only concerned that someone using the library may expect the padding characters to be returned, and need them for some reason. I'm happy with the fix as you have it, but just to be safe you might want to make the next tag 1.4.0.

looks like the commits on here were in another pr that got merged

Yeah, sorry about that.