Magik.Formatter (magik v0.1.1)

Provides functions to format value to string

Link to this section Summary

Functions

Format currency value to thousand separated string

Format number to thousand seperated string

Link to this section Functions

Link to this function

format_currency(number, opts \\ [])

Format currency value to thousand separated string

Parameters

  • number: integer number
  • opts: list of format options
    • thousand_separator: thousand separator character. Default is ,
    • currency: currency character. Default is "đ"

Example

iex> Magik.Formatter.format_currency("1232321", thousand_separator: ".", currency: "$") 1.232.321$

Link to this function

format_thousand(number, separator \\ ".")

Format number to thousand seperated string

Parameters

  • number: integer number
  • separator: thousand separator character. Default is .

Example

iex> Magik.Formatter.format_thousand("1232321", ".")
1.232.321