dec

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 1 Imported by: 6

README

dec

Helper for working with decimals in Go.

Documentation

Overview

Package dec is a set of helpers and syntax sugar for github.com/shopspring/decimal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Between

func Between(v, lower, upper decimal.Decimal) bool

func New

func New[T number](v T) decimal.Decimal

New creates a new instance of decimal.Decimal from the given number. Int values are cast to float64 for conversion. Ensures equal internal representation by decimal.Decimal of the equivalent input number. Thus enables expected behaviour in equality funcs such as assert.Equal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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