utils

package
v0.0.1-alpha.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Any

func Any[K comparable](arr []K, predicate func(K) bool) bool

func CalculateTimeDuration

func CalculateTimeDuration(minutes, interval int) time.Duration

CalculateTimeDuration calculates the time duration for the given minutes and interval.

For example, if minutes is 60 and interval is 5, the result will be 12 minutes because the division of `minutes` (60) by `interval` (5) is 12. The result (12) is then multiplied by time.Minute, which represents 1 minute in Go's time package.

func RoundStepSize

func RoundStepSize(quantity, stepSize float64) float64

RoundStepSize rounds a given quantity to a specific step size.

Parameters:

  • quantity: The quantity to be rounded.
  • stepSize: The step size to round to.

Returns:

The rounded quantity.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL