Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 773 Bytes

README.md

File metadata and controls

31 lines (22 loc) · 773 Bytes

Ucumex

A elixir lib according to THE UNIFIED CODE FOR UNITS OF MEASURE to convert unit.

Note!

  • Comment is not Supported
  • Special Units are not Supported Except Fahrenheit Degree and Celsius Degree

Examples

{:ok, op} = Ucumex.convertor("km", "m")

op.(3) # -> 3.0e3
# "[degRe]" is special unit
Ucumex.convertor("km", "[degRe]")

** (NotImplementedError) handler is not implemented for this special unit.
    (ucumex) lib/ucumex.ex:390: Ucumex.to_basic_units/1
    (ucumex) lib/ucumex.ex:48: Ucumex.to_bin_op/2
    (ucumex) lib/ucumex.ex:24: Ucumex.unit_to_std/1
    (ucumex) lib/ucumex.ex:17: Ucumex.convertor/2
{:error, :unit_not_match} = Ucumex.convertor("km", "L")