Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number values of null vs 0 #38

Open
stevepridemore opened this issue Dec 14, 2015 · 2 comments
Open

Number values of null vs 0 #38

stevepridemore opened this issue Dec 14, 2015 · 2 comments

Comments

@stevepridemore
Copy link

@field(offset = 635, length = 5, align = Align.RIGHT, paddingChar = '0')
@FixedFormatDecimal(decimals = 2, decimalDelimiter = '.', useDecimalDelimiter = false)
@FixedFormatNumber(sign = Sign.NOSIGN)

The project I am currently working on has to be able to support numbers with either a null or zero value. For a null value the string for this field would be ' ' and the zero value would be '00000'. I am at a loss of how to do this using fixedformat4j. It would be great if it had a nullChar attribute as well.

@field(offset = 635, length = 5, align = Align.RIGHT, paddingChar = '0', nullChar=' ')
or
@FixedFormatNumber(sign = Sign.NOSIGN, nullChar=' ') if it was just for numbers

@jeyben
Copy link
Owner

jeyben commented Dec 17, 2015

My suggestion is to create your own custom formatter for this field

@ty-vincenthung
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants