goprice

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: MIT Imports: 6 Imported by: 0

README

go-price

A package for beauty price in an e-commerce site

Documentation

Index

Constants

View Source
const (
	DefaultRoundOnFloat     = 0.6
	DefaultRoundPlacesFloat = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Price

type Price float64

func NewPrice

func NewPrice(value float64) *Price

func (*Price) Add

func (a *Price) Add(value *Price)

func (*Price) Copy

func (a *Price) Copy() *Price

func (Price) MarshalJSON

func (a Price) MarshalJSON() ([]byte, error)

func (*Price) Minus

func (a *Price) Minus(value *Price)

func (*Price) Multiply

func (a *Price) Multiply(value *Price)

func (Price) RoundPriceStringFormatAtCheckout

func (a Price) RoundPriceStringFormatAtCheckout(roundOn float64, precision int) string

func (Price) ToAdyenInt

func (a Price) ToAdyenInt() int

func (Price) ToAdyenString

func (a Price) ToAdyenString(adyenInt *int) string

func (Price) ToFloat64

func (a Price) ToFloat64() float64

func (Price) ToString

func (a Price) ToString() string

func (Price) ToStringWithCurrencySymbol

func (a Price) ToStringWithCurrencySymbol(currencySymbol string) string

func (*Price) UnmarshalJSON

func (a *Price) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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