quantity

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package quantity represents a quantity in the system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Quantity

type Quantity struct {
	// contains filtered or unexported fields
}

Quantity represents a quantity in the system.

func MustParse

func MustParse(value int) Quantity

MustParse parses the string value and returns a quantity if the value complies with the rules for a quantity. If an error occurs the function panics.

func Parse

func Parse(value int) (Quantity, error)

Parse parses the float value and returns a quantity if the value complies with the rules for quantity.

func (Quantity) Equal

func (q Quantity) Equal(q2 Quantity) bool

Equal provides support for the go-cmp package and testing.

func (Quantity) MarshalText

func (q Quantity) MarshalText() ([]byte, error)

MarshalText provides support for logging and any marshal needs.

func (Quantity) String

func (q Quantity) String() string

String returns the value of the quantity.

func (Quantity) Value

func (q Quantity) Value() int

Value returns the int value of the quantity.

Jump to

Keyboard shortcuts

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