package decimal
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/decimal"
Index ¶
- func Append(p []byte, x *big.Int) []byte
- func BigIntToByte(x *big.Int, precision, scale uint32) (p [16]byte)
- func Err() *big.Int
- func Format(x *big.Int, precision, scale uint32) string
- func FromBytes(bts []byte, precision, scale uint32) *big.Int
- func FromInt128(p [16]byte, precision, scale uint32) *big.Int
- func Inf() *big.Int
- func IsErr(x *big.Int) bool
- func IsInf(x *big.Int) bool
- func IsNaN(x *big.Int) bool
- func NaN() *big.Int
- func Parse(s string, precision, scale uint32) (*big.Int, error)
- type Decimal
- type ParseError
Functions ¶
func Append ¶
func BigIntToByte ¶
BigIntToByte returns the 16-byte array representation of x.
If x value does not fit in 16 bytes with given precision, it returns 16-byte representation of infinity or negative infinity value accordingly to x's sign.
func Err ¶
Err returns "error" value.
func Format ¶
Format returns the string representation of x with the given precision and scale.
func FromBytes ¶
FromBytes converts bytes representation of decimal to big integer. Most callers should use FromInt128().
If given bytes contains value that is greater than given precision it returns infinity or negative infinity value accordingly the bytes sign.
func FromInt128 ¶
FromInt128 returns big integer from given array. That is, it interprets 16-byte array as 128-bit integer.
func Inf ¶
Inf returns infinity value.
func IsErr ¶
IsErr reports whether x is an "error" value.
func IsInf ¶
IsInf reports whether x is an infinity.
func IsNaN ¶
IsNaN reports whether x is a "not-a-number" value.
func NaN ¶
NaN returns "not-a-number" value.
func Parse ¶
Parse interprets a string s with the given precision and scale and returns the corresponding big integer.
Types ¶
type Decimal ¶
func (*Decimal) BigInt ¶
func (*Decimal) String ¶
type ParseError ¶
func (*ParseError) Error ¶
func (p *ParseError) Error() string
func (*ParseError) Unwrap ¶
func (p *ParseError) Unwrap() error
Source Files ¶
- Version
- v3.59.3
- Published
- Mar 24, 2024
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 minute ago –
Tools for package owners.