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

Intruduce optional mode parameter #12

Merged
merged 1 commit into from
Dec 14, 2022
Merged

Conversation

excpt
Copy link
Owner

@excpt excpt commented Dec 14, 2022

If mode parameter is set to :precise all calculations will return decimal numbers instead of integer numbers.

Example:

from = Time.new(2022, 8, 4, 15, 52, 25, '-06:00')
to = Time.new(2022, 8, 18, 15, 52, 31, '-06:00')

difference = Moments.difference(from, to, :precise).in_minutes

# returns: 20_160.1

If mode parameter is set to `:precise` all calculations will return
decimal numbers instead of integer numbers.

Example:

  from Time.new(2022, 8, 4, 15, 52, 25, '-06:00')
  to = Time.new(2022, 8, 18, 15, 52, 31, '-06:00')

  difference = Moments.difference(from, to, :precise).in_minutes

difference returns: 20_160.1
@excpt excpt merged commit f50386f into master Dec 14, 2022
This was referenced Dec 14, 2022
@Nitrodist
Copy link

Wow, thanks for this 🙇

@bethesque
Copy link

I'd love to have this released please.

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.

3 participants