package decimal
import "github.com/microsoft/go-mssqldb/internal/decimal"
Index ¶
- func ScaleBytes(s string, scale uint8) []byte
- type Decimal
- func Float64ToDecimal(f float64) (Decimal, error)
- func Float64ToDecimalScale(f float64, scale uint8) (Decimal, error)
- func Int64ToDecimalScale(v int64, scale uint8) Decimal
- func StringToDecimalScale(v string, outScale uint8) (Decimal, error)
- func (d Decimal) BigInt() big.Int
- func (d Decimal) Bytes() []byte
- func (d *Decimal) IsPositive() bool
- func (d *Decimal) SetInteger(integer uint32, ind uint8)
- func (d *Decimal) SetPositive(positive bool)
- func (d *Decimal) SetPrec(prec uint8)
- func (d *Decimal) SetScale(scale uint8)
- func (d Decimal) String() string
- func (d Decimal) ToFloat64() float64
- func (d Decimal) UnscaledBytes() []byte
Functions ¶
func ScaleBytes ¶
ScaleBytes converts a stringified decimal to a scaled byte slice
Types ¶
type Decimal ¶
type Decimal struct {
// contains filtered or unexported fields
}
Decimal represents decimal type in the Microsoft Open Specifications: http://msdn.microsoft.com/en-us/library/ee780893.aspx
func Float64ToDecimal ¶
Float64ToDecimal converts float64 to decimal
func Float64ToDecimalScale ¶
Float64ToDecimalScale converts float64 to decimal; user can specify the scale
func Int64ToDecimalScale ¶
Int64ToDecimalScale converts float64 to decimal; user can specify the scale
func StringToDecimalScale ¶
StringToDecimalScale converts string to decimal
func (Decimal) BigInt ¶
BigInt converts decimal to a bigint
func (Decimal) Bytes ¶
Bytes converts decimal to a scaled byte slice
func (*Decimal) IsPositive ¶
IsPositive returns true if the Decimal is positive
func (*Decimal) SetInteger ¶
SetInteger sets the ind'th element in the integer array
func (*Decimal) SetPositive ¶
SetPositive sets the positive member
func (*Decimal) SetPrec ¶
SetPrec sets the prec member
func (*Decimal) SetScale ¶
SetScale sets the scale member
func (Decimal) String ¶
String converts decimal to a string
func (Decimal) ToFloat64 ¶
ToFloat64 converts decimal to a float64
func (Decimal) UnscaledBytes ¶
UnscaledBytes converts decimal to a unscaled byte slice
Source Files ¶
- Version
- v0.17.0
- Published
- Aug 17, 2022
- Platform
- js/wasm
- Imports
- 6 packages
- Last checked
- 1 hour ago –
Tools for package owners.