billing

package
v0.0.0-...-a08dd98 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Money

type Money int64

Money value type: first 9 numbers it's float part Example:

1_000000000 => 1    $
0_010000000 => 0.01 $

func MoneyFloat

func MoneyFloat[T constraints.Float](amount T) Money

MoneyFloat object

func MoneyInt

func MoneyInt[T constraints.Integer](amount T) Money

MoneyInt object

func (*Money) DecodeValue

func (m *Money) DecodeValue(v any) (err error)

DecodeValue implements the gocast.Decoder

func (Money) Float64

func (m Money) Float64() float64

Float64 value from money

func (Money) Int64

func (m Money) Int64() int64

Int64 value from money

func (Money) MarshalJSON

func (m Money) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler

func (*Money) Scan

func (m *Money) Scan(value any) error

Scan implements the sql.Scanner interface

func (*Money) SetFromFloat64

func (m *Money) SetFromFloat64(v float64)

SetFromFloat64 value

func (*Money) SetFromInt64

func (m *Money) SetFromInt64(v int64)

SetFromInt64 value

func (Money) String

func (m Money) String() string

String implementation of Stringer interface

func (*Money) UnmarshalJSON

func (m *Money) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaller

func (*Money) UnmarshalYAML

func (m *Money) UnmarshalYAML(unmarshal func(any) error) error

Implements the Unmarshaler interface of the yaml pkg.

func (Money) Value

func (m Money) Value() (driver.Value, error)

Value implements the driver.Valuer interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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