ex_uc v1.0.3 ExUc.Special
Special conversions.
For conversions where simple formulas are not enough the config file will reference using an atom a method of this module.
Summary
Functions
Converts from feet and inches, to feet
Checks if a string is a special feet and inches value
Checks if a string is a special pounds and ounces value
Converts from kilograms to pounds and ounces
Converts from pounds and ounces, to pounds
Converts from meters to feet and inches
Functions
Converts from feet and inches, to feet.
Returns {VALUE_IN_FEET, “ft”}
Parameters
- str: String with feet and inches value
Examples
iex>ExUc.Special.ft_in_to_ft("7 ft 6 in")
{7.5, "ft"}
Checks if a string is a special feet and inches value.
Returns Boolean
Parameters
- str: String with values and units.
Examples
iex>ExUc.Special.is_feet_and_inches?("6 ft 2.2 in")
true
iex>ExUc.Special.is_feet_and_inches?("6 ft")
false
Checks if a string is a special pounds and ounces value
Returns Boolean
Parameters
- str: String with values and units.
Examples
iex>ExUc.Special.is_pounds_and_ounces?("23 lb 4 oz")
true
iex>ExUc.Special.is_pounds_and_ounces?("12.566 lb")
false
Converts from kilograms to pounds and ounces
Returns String.t
Parameters
- value: Numeric value for kilograms.
Examples
iex>ExUc.Special.kg_to_lb_oz(20.15)
"44 lb 6.76 oz"