SigmaKit.Util (sigma_kit v0.0.16)

Summary

Functions

Examples:

iex> number_with_delimiter(1000)
"1,000"
iex> number_with_delimiter(1000000)
"1,000,000"

Opposite of blank?

Get a random numeric string of given length.

Get a random string of given length. Returns a random url safe encoded64 string of the given length. Used to generate tokens for the various modules that require unique tokens.

Trim whitespace on either end of a string. Account for nil

Useful for when you have an array of strings coming in from a user form

Functions

blank?(term)

format_money(cents, currency \\ "USD")

number_with_delimiter(i)

Examples:

iex> number_with_delimiter(1000)
"1,000"
iex> number_with_delimiter(1000000)
"1,000,000"

pluralize(word, count)

present?(term)

Opposite of blank?

random_numeric_string(length \\ 10)

Get a random numeric string of given length.

random_string(length \\ 10)

Get a random string of given length. Returns a random url safe encoded64 string of the given length. Used to generate tokens for the various modules that require unique tokens.

trim(str)

Trim whitespace on either end of a string. Account for nil

trim_strings_in_array(array)

Useful for when you have an array of strings coming in from a user form