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
number_f lib number_f currency.ex
Raw

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: NumberF.CustomFormatter.number_to_currency(value, unit: unit, precision: precision)
def comma_separated(value, _precision) when is_nil(value), do: value
def comma_separated(value, precision),
do: NumberF.CustomFormatter.number_to_currency(value, unit: "", precision: precision)
end