decimal

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package decimal provides a wrapper around github.com/shopspring/decimal for arbitrary-precision fixed-point decimal numbers.

Index

Constants

This section is empty.

Variables

View Source
var (
	Zero  = decimal.Zero
	One   = decimal.NewFromInt(1)
	Two   = decimal.NewFromInt(2)
	Three = decimal.NewFromInt(3)
	Four  = decimal.NewFromInt(4)
	Five  = decimal.NewFromInt(5)
	Six   = decimal.NewFromInt(6)
	Seven = decimal.NewFromInt(7)
	Eight = decimal.NewFromInt(8)
	Nine  = decimal.NewFromInt(9)
	Ten   = decimal.NewFromInt(10)
)

Common decimal constants.

View Source
var (
	New                      = decimal.New
	NewFromFloat             = decimal.NewFromFloat
	NewFromFloat32           = decimal.NewFromFloat32
	NewFromFloatWithExponent = decimal.NewFromFloatWithExponent
	NewFromInt               = decimal.NewFromInt
	NewFromInt32             = decimal.NewFromInt32
	NewFromUint64            = decimal.NewFromUint64
	NewFromBigInt            = decimal.NewFromBigInt
	NewFromBigRat            = decimal.NewFromBigRat
	NewFromString            = decimal.NewFromString
	NewFromFormattedString   = decimal.NewFromFormattedString
	RequireFromString        = decimal.RequireFromString
)

Constructors for creating Decimal values.

View Source
var (
	Max         = decimal.Max
	Min         = decimal.Min
	Sum         = decimal.Sum
	Avg         = decimal.Avg
	RescalePair = decimal.RescalePair
)

Utility functions for decimal operations.

Functions

This section is empty.

Types

type Decimal

type Decimal = decimal.Decimal

Decimal is an alias for decimal.Decimal.

Jump to

Keyboard shortcuts

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