Documentation ¶
Index ¶
- func DecimalDigits[T constraints.Integer](num T) int
- func FloatToString[T constraints.Float](n T, precision int) string
- func IntToString[T constraints.Integer](n T) string
- func NumToAccountingString[T Num](f T, precision int) string
- func StringToFloat[T constraints.Float](s string) (T, error)
- func StringToInt[T constraints.Integer](s string) (T, error)
- type Num
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecimalDigits ¶
func DecimalDigits[T constraints.Integer](num T) int
func FloatToString ¶
func FloatToString[T constraints.Float](n T, precision int) string
func IntToString ¶
func IntToString[T constraints.Integer](n T) string
func NumToAccountingString ¶
NumToAccountingString converts a number to an accounting string. Caution: This is an example, in practical some countries may have different accounting format.
func StringToFloat ¶
func StringToFloat[T constraints.Float](s string) (T, error)
func StringToInt ¶
func StringToInt[T constraints.Integer](s string) (T, error)
Types ¶
type Num ¶
type Num interface { constraints.Integer | constraints.Float }
Click to show internal directories.
Click to hide internal directories.