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

R4R: Increase decimal precision to 18 #3315

Merged
merged 6 commits into from
Jan 17, 2019
Merged

Conversation

rigelrozanski
Copy link
Contributor

@rigelrozanski rigelrozanski commented Jan 17, 2019

closes #3039

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote tests
  • Updated relevant documentation (docs/)
  • Added entries in PENDING.md with issue #
  • rereviewed Files changed in the github PR explorer

For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@rigelrozanski rigelrozanski added wip T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). labels Jan 17, 2019
@rigelrozanski rigelrozanski changed the title WIP: Decimal precision increase WIP: Increase decimal precision to 18 Jan 17, 2019

copy(bzStr, bzInt[:decPointPlace]) // pre-decimal digits
bzStr[decPointPlace] = byte('.') // decimal point
copy(bzStr[decPointPlace+1:], bzInt[decPointPlace:]) // post-decimal digits
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the vital change

@codecov
Copy link

codecov bot commented Jan 17, 2019

Codecov Report

Merging #3315 into develop will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           develop   #3315      +/-   ##
==========================================
- Coverage    55.62%   55.6%   -0.03%     
==========================================
  Files          132     132              
  Lines         9540    9540              
==========================================
- Hits          5307    5305       -2     
- Misses        3898    3900       +2     
  Partials       335     335

@rigelrozanski rigelrozanski changed the title WIP: Increase decimal precision to 18 R4R: Increase decimal precision to 18 Jan 17, 2019
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

The changes to types/decimal.go look fine. Can we make the testcases also dependent on Precision, so we can adjust precision in the future without breaking the tests?

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Approved pending test changes suggested by @cwgoes

@cwgoes
Copy link
Contributor

cwgoes commented Jan 17, 2019

@rigelrozanski

Nonfunctional at the moment; we must have some subtle dependency on 10 decimal points.

Is this still accurate?

@rigelrozanski
Copy link
Contributor Author

@cwgoes - not accurate anymore - deleting

@rigelrozanski
Copy link
Contributor Author

so we can adjust precision in the future without breaking the tests?

I don't think we should do this for the reason that it will make reading the tests more confusing (rather than just seeing the string, you have to now interpret the string from a function) - as well not all of the test cases actually end in ".000000000" - I don't anticipate us changing the number of places very often and its only a 5 minute fix when we need it

  • aka. I don't think this makes sense to do, so I'm going to leave it

@cwgoes
Copy link
Contributor

cwgoes commented Jan 17, 2019

I don't think we should do this for the reason that it will make reading the tests more confusing (rather than just seeing the string, you have to now interpret the string from a function) - as well not all of the test cases actually end in ".000000000" - I don't anticipate us changing the number of places very often and its only a 5 minute fix when we need it

OK, fair enough.

@cwgoes cwgoes merged commit d9e32e9 into develop Jan 17, 2019
@cwgoes cwgoes deleted the rigel/increase-decimal-precision branch January 17, 2019 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increase number of decimal places in sdk.Decimal
3 participants