Documentation ¶
Index ¶
- Variables
- func ConvertToStringWithDecimal(num int, fraction int) string
- func DisplayFull(num int, alpha string) (string, error)
- func DisplayNoSymbol(num int, alpha string) (string, error)
- func DisplayWithAlpha(num int, alpha string) (string, error)
- func DisplayWithDecimal(num int, alpha string) (string, error)
- func FormatCurrency(num int, ISO Currency) string
- func GetAlphaFromISONumeric(num string) (string, error)
- func GetISOCodeFromNumeric(num string) (string, error)
- func InsertDelimiter(str string, group int, del string) string
- func IsNegative(num int) bool
- func RemoveDecimal(str string, dec string) string
- func RemoveDelimiter(str string, del string) string
- func RemoveSymbol(str string, sym string) string
- func ReverseString(str string) string
- func StringToInt(num string, alpha string) (int, error)
- func SwapSymbolWithAlpha(str string, sym string, alpha string) string
- type Currency
Constants ¶
This section is empty.
Variables ¶
var CurrencyList = map[string]Currency{}/* 157 elements not displayed */
CurrencyList - complete list of supported currencies
var ErrorInvalidISO = errors.New("Invalid ISO Code")
ErrorInvalidISO : returns an error for an invalid ISO code
var ErrorInvalidStringFormat = errors.New("Unable To Convert Invalid String Format")
ErrorInvalidStringFormat : returns an error if trying to convert an invalid string value
var ErrorUnableToFormatCurrency = errors.New("Unable To Format Currency")
ErrorUnableToFormatCurrency : returns an error for invalid currency formatting
var ErrorUnableToFormatCurrencyFromString = errors.New("Unable To Format Currency From String")
ErrorUnableToFormatCurrencyFromString : returns an error for invalid formatting from a string
Functions ¶
func ConvertToStringWithDecimal ¶
ConvertToStringWithDecimal : returns the uint as a stringified float
func DisplayFull ¶
DisplayFull : returns a string with full currency formatting... "num" being the amount, "alpha" being the ISO three digit alphabetic code.
func DisplayNoSymbol ¶
DisplayNoSymbol : returns a string with full currency formatting minus the ISO symbol... "num" being the amount, "alpha" being the ISO three digit alphabetic code.
func DisplayWithAlpha ¶
DisplayWithAlpha : returns a string with full currency formatting with the symbol replaced by the ISO three digit alphabetic code... "num" being the amount, "alpha" being the ISO three digit alphabetic code.
func DisplayWithDecimal ¶
DisplayWithDecimal : returns a string with all currency formatting removed except decimal places... "num" being the amount, "alpha" being the ISO three digit alphabetic code.
func FormatCurrency ¶
FormatCurrency : returns basic currency formatting
func GetAlphaFromISONumeric ¶
GetAlphaFromISONumeric : returns a formatted ISO alpha code from the ISO numeric counterpart
func GetISOCodeFromNumeric ¶
GetISOCodeFromNumeric : returns a formatted ISO numeric code or an error if the ISO is not found
func InsertDelimiter ¶
InsertDelimiter : returns a new string with delimiter formatting
func IsNegative ¶ added in v0.1.6
IsNegative : returns a bool based on whether the int is negative or positive
func RemoveDecimal ¶
RemoveDecimal : returns a string with the decimal removed
func RemoveDelimiter ¶
RemoveDelimiter : returns a string with the delimiter removed
func RemoveSymbol ¶
RemoveSymbol : returns a string with the symbol removed
func ReverseString ¶
ReverseString : returns a reversed string for delimiter formatting
func StringToInt ¶ added in v0.1.3
StringToInt : returns a int from a string value
Types ¶
type Currency ¶
type Currency struct { Unit string Alpha string Numeric string Symbol string Fraction int Decimal string Grouping int Delimiter string SymbolPositionFront bool }
Currency - struct containing currency variables
func GetISOFromAlpha ¶
GetISOFromAlpha : returns a formatted ISO alpha code or an error if the ISO is not found
func ListCurrencies ¶
ListCurrencies : returns a list of currencies
func TopCurrencies ¶
TopCurrencies returns the list of top currencies based upon usage