Skip to content

Conversation

@lutovich
Copy link
Contributor

@lutovich lutovich commented May 7, 2018

Database normalizes nanoseconds to be in range from 0 to 999999999. Duration class previously did not calculations with given seconds and nanoseconds and could thus store non-normalized values. It also did not re-calculate values for the toString() function and returned incorrect value.

This PR makes Duration class normalize given seconds and nanoseconds during construction. It also changes the toString() function to correctly format the normalized values.

Database normalizes nanoseconds to be in range from 0 to 999999999.
`Duration` class previously did not calculations with given seconds and
nanoseconds and could thus store non-normalized values. It also did not
re-calculate values for the `toString()` function and returned
incorrect value.

This commit makes `Duration` class normalize given seconds and
nanoseconds during construction. It also changes the `toString()`
function to correctly format the normalized values.
@lutovich lutovich requested a review from ali-ince May 7, 2018 16:20
@lutovich lutovich changed the base branch from 1.7 to 1.6 May 7, 2018 16:20
@ali-ince ali-ince merged commit 398e443 into neo4j:1.6 May 8, 2018
@lutovich lutovich deleted the 1.6-ns-normalization branch May 8, 2018 08:28
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