XT.Seed (xt v0.1.1) View Source
Seed Utilities Functions
Link to this section Summary
Functions
Convert the given fields to float values for the Map
Convert the given fields to float values for the Map
Convert the given field to float value for the Map
Convert the given field to float value for the Map
Parse the string into a float
Parse the string into a float
Link to this section Functions
Specs
Convert the given fields to float values for the Map
Examples
iex> XT.Seed.convert_fields_to_float(%{balance: "1.1"}, [:balance]) %{balance: 1.1}
iex> XT.Seed.convert_fields_to_float(%{balance: "3333.333", name: "john"}, [:balance]) %{balance: 3333.333, name: "john"}
Specs
Convert the given fields to float values for the Map
Examples
iex> XT.Seed.convert_fields_to_int(%{balance: "10"}, [:balance]) %{balance: 10}
iex> XT.Seed.convert_fields_to_int(%{balance: "11", name: "john"}, [:balance]) %{balance: 11, name: "john"}
Specs
Convert the given field to float value for the Map
Examples
iex> XT.Seed.convert_to_float(%{balance: "3.33"}, :balance) %{balance: 3.33}
iex> XT.Seed.convert_to_float(%{balance: "1.11", name: "john"}, :balance) %{balance: 1.11, name: "john"}
Specs
Convert the given field to float value for the Map
Examples
iex> XT.Seed.convert_to_int(%{balance: "10"}, :balance) %{balance: 10}
iex> XT.Seed.convert_to_int(%{balance: "11", name: "john"}, :balance) %{balance: 11, name: "john"}
Specs
Parse the string into a float
Specs
Parse the string into a float