Documentation ¶
Index ¶
Constants ¶
View Source
const ( AllowedCharacters = "0123456789.-eE" BigDecRegEx = "-?(?:[0|1-9]\\d*)(?:\\.\\d+)?(?:[eE][+\\-]?\\d+)?" )
Variables ¶
View Source
var ( ErrInvalidCharacter = fmt.Errorf("value contains invalid characters. Only the following are allowed: %q", AllowedCharacters) ErrInvalidZeroValue = errors.New("value cannot be zero") ErrInvalidScale = errors.New("scale too large") )
Functions ¶
This section is empty.
Types ¶
type BigDecimal ¶
type BigDecimal struct { Scale int Precision int UnscaledValue string Sign int // 1 for negative, 0 for positive }
func NewBigDecimal ¶
func NewBigDecimal(value string) (bd *BigDecimal, err error)
Creates a new custom BigDecimal object from a value string
func (*BigDecimal) GetScaledValue ¶
func (bd *BigDecimal) GetScaledValue() string
Click to show internal directories.
Click to hide internal directories.