spring-projects / spring-projects/spring-batch

DefaultFieldSet readBigDecimal should allow to pass a long unscaled value with a int scale

Open
#3,678 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: enhancement
Dominant language
Java
Stars
3k
Forks
2.5k
Avg merge
6d 53m
Merged PRs (30d)
3

Description

There are some cases, specially in fixed length files that the decimal values comes without any decimal separator, but the layout or the documentation specifies the number of decimal places. So the DefaultFieldSet.readBigDecimal should allow to read the value as long (unscaledVal) and pass the number of decimal digits (BigDecimal's scale).

The implementation could use the BigDecimal valueOf(long unscaledVal, int scale)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating DefaultFieldSet.readBigDecimal and review how it currently constructs BigDecimal values. Check the BigDecimal.valueOf(long, int) API and fixed-length field handling; the work is done when an unscaled long and decimal-place scale can be supplied and produce the documented value.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.