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

Rounding options to toRelative #1684

Closed
wants to merge 0 commits into from
Closed

Conversation

Shiva127
Copy link

This PR fully address the issue described in #1129 (and fully replace PR #1683) by introducing an additional rounding option. This PR is fully backward compatible.

Problem

Before this PR, the only option for rounding with toRelative() is to rounds towards zero.

Solution

With this PR, I add a new parameter rounding who can be "towardsZero", "awayFromZero", "round", "floor", or "ceil" to address all options. The rounding option works with round: true and round: false.

I'm open for better names for "towardsZero", "awayFromZero".

Copy link

linux-foundation-easycla bot commented Feb 19, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

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.

1 participant