Documentation ¶
Index ¶
- Variables
- func DecimalFormat(d decimal.Decimal, opts *Options) (formatted string)
- func DecimalRound(d decimal.Decimal, opts *Options) (decimal.Decimal, error)
- type Option
- func WithDecimalPlaces(decimalPlaces uint) Option
- func WithDecimalSeparator(decimalSeparator byte) Option
- func WithFractionGroupSeparator(fractionGroupSeparator byte) Option
- func WithFractionGroupSize(fractionGroupSize uint) Option
- func WithGroupSeparator(groupSeparator byte) Option
- func WithGroupSize(groupSize uint) Option
- func WithRoundingMode(mode constants.Rounding) Option
- func WithRoundingPrecision(precision int) Option
- func WithSecondaryGroupSize(secondaryGroupSize uint) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidRM invalid rounding mode ErrInvalidRM = errors.New("invalid rounding mode") )
Functions ¶
func DecimalFormat ¶
DecimalFormat produces a string form of the given decimal.Decimal in base 10
ref: https://github.com/dustin/go-humanize/blob/master/commaf.go#L13
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithDecimalPlaces ¶
func WithDecimalSeparator ¶
func WithFractionGroupSize ¶
func WithGroupSeparator ¶
func WithGroupSize ¶
func WithRoundingMode ¶
func WithRoundingPrecision ¶
func WithSecondaryGroupSize ¶
Click to show internal directories.
Click to hide internal directories.