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

Issue #78 Implementing Number Format Parser #97

Merged
merged 21 commits into from
Dec 13, 2021

Conversation

robons
Copy link
Contributor

@robons robons commented Dec 7, 2021

This PR gets basic Unicode UTS-35/TR-35/UAX-35 number format validation functioning within the standards set out by unicode and the W3C CSV-W working group. Notably, all W3C CSV-W tests relating to number format validation now pass successfully.

N.B. It is not required that we implement the full UTS-35 specification. This PR does support the padding, rounding or significant digits functionality, however it is entirely possible to retrofit this functionality at a later point in time, if desired.

Implementations MUST recognise number format patterns containing the symbols 0, #, the specified decimalChar (or "." if unspecified), the specified groupChar (or "," if unspecified), E, +, % and ‰. Implementations MAY additionally recognise number format patterns containing other special pattern characters defined in [UAX35]
W3C CSV-W - Number Format Minimum Standards

N.B. This approach parses all numbers to the BigDecimal infinite precision datatype. This isn't likely to be the most performant approach, but it is simple to convert the parsed value from a string into a numeric representation.

Newly created issues: #98, #99

This PR satisfies #90.

@robons robons marked this pull request as ready for review December 9, 2021 11:57
@robons robons changed the title WIP - Issue #78 Implementing Number Format Parser Issue #78 Implementing Number Format Parser Dec 9, 2021
Copy link
Contributor

@cjfairchild cjfairchild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see comments for actionable issues - they're minor - one for error catching and likely compiler complaints and another for documentation around the ArrayCursor class.

src/main/scala/Column.scala Outdated Show resolved Hide resolved
src/main/scala/models/ArrayCursor.scala Show resolved Hide resolved
@cjfairchild cjfairchild merged commit c531058 into master Dec 13, 2021
@robons robons deleted the robons-78-number-format-parser-2 branch December 14, 2021 08:41
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

Successfully merging this pull request may close these issues.

2 participants