Packages
A comprehensive Elixir library for number formatting, calculation, and internationalization. Features include currency formatting, number-to-word conversion, financial calculations, statistics, unit conversion, and tax calculations.
Current section
Files
Jump to
Current section
Files
lib/number_f/currency.ex
defmodule NumberF.Currency do
@moduledoc false
def currency(value, _unit, _precision) when is_nil(value), do: value
def currency(value, unit, precision) do
to_string(value)
|> Number.Currency.number_to_currency(unit: unit, precision: precision)
end
def comma_separated(value, _precision) when is_nil(value), do: value
def comma_separated(value, precision) do
to_string(value)
|> Number.Currency.number_to_currency(unit: "", precision: precision)
end
end