percent

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Change

func Change[T constraints.Integer | constraints.Float](before, after T) float64

Change returns the percent increase/decrease from two numbers.

func FromRatio

func FromRatio[T constraints.Integer | constraints.Float](ratio T) float64

FromRatio returns the percent of ratio.

func Percent

func Percent[T constraints.Integer | constraints.Float](percent, value T) float64

Percent returns the value of a percentage of a value.

func PercentOf

func PercentOf[T constraints.Integer | constraints.Float](part, total T) float64

PercentOf returns the percentage of a part in the total value.

func Remain

func Remain[T constraints.Integer | constraints.Float](percent, value T) float64

Remain returns the value that remains after subtracting the percentage.

func ToRatio

func ToRatio[T constraints.Integer | constraints.Float](percent T) float64

ToRatio returns the ratio of percent.

Types

This section is empty.

Jump to

Keyboard shortcuts

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