Documentation
¶
Index ¶
- func IsZero(s string) bool
- type NumeroALetras
- func (n *NumeroALetras) ToInvoice(number float64, decimals int, currency string) (string, error)
- func (n *NumeroALetras) ToMoney(number float64, decimals int, currency, cents string) (string, error)
- func (n *NumeroALetras) ToString(number float64, decimals int, wholeStr, decimalStr string) (string, error)
- func (n *NumeroALetras) ToWords(number float64, decimals int) (string, error)
- func (n *NumeroALetras) UseApocope(value bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NumeroALetras ¶
type NumeroALetras struct {
Conector string
// contains filtered or unexported fields
}
NumeroALetras is a struct that provides methods to convert numbers to their Spanish word representations.
func NewNumeroALetras ¶
func NewNumeroALetras() *NumeroALetras
NewNumeroALetras initializes and returns a new instance of NumeroALetras with default values.
func (*NumeroALetras) ToInvoice ¶
ToInvoice converts a number to its invoice representation in words. number: The number to be converted. decimals: The number of decimal places to consider. Default is 2. currency: The currency to append at the end.
func (*NumeroALetras) ToMoney ¶
func (n *NumeroALetras) ToMoney(number float64, decimals int, currency, cents string) (string, error)
ToMoney converts a numeric value to its money representation in words. number: The numeric value to be converted. decimals: The number of decimal places to consider. Default is 2. currency: The currency to append to the whole number part. cents: The currency to append to the decimal part.
func (*NumeroALetras) ToString ¶
func (n *NumeroALetras) ToString(number float64, decimals int, wholeStr, decimalStr string) (string, error)
ToString converts a number to its string representation with specified whole and decimal strings. number: The number to be converted. decimals: The number of decimal places to include. wholeStr: The string to use for the whole number part. decimalStr: The string to use for the decimal part.
func (*NumeroALetras) ToWords ¶
func (n *NumeroALetras) ToWords(number float64, decimals int) (string, error)
ToWords converts a numeric value to its word representation. number: The number to be converted. decimals: The number of decimal places to consider. Default is 2.
func (*NumeroALetras) UseApocope ¶
func (n *NumeroALetras) UseApocope(value bool)
checkApocope modifies the 'unidades' array if Apocope is set to true.