Code Monkey home page Code Monkey logo

cldr_units's Introduction

Cldr for Units

Build Status Deps Status Hex pm License

Introduction and Getting Started

ex_cldr_units is an addon library for ex_cldr that provides localisation and formatting for units such as weights, lengths, areas, volumes and so on.

The primary api is Cldr.Unit.to_string/2. The following examples demonstrate:

iex> Cldr.Unit.to_string 123, :volume_gallon
{:ok, "123 gallons"}

iex> Cldr.Unit.to_string 1234, :volume_gallon, format: :long
{:ok, "1 thousand gallons"}

iex> Cldr.Unit.to_string 1234, :volume_gallon, format: :short
{:ok, "1K gallons"}

iex> Cldr.Unit.to_string 1234, :frequency_megahertz
{:ok, "1,234 megahertz"}

For help in iex:

iex> h Cldr.Unit.to_string

Documentation

Primary documentation is available as part of the hex documentation for ex_cldr

Installation

Note that :ex_cldr_units requires Elixir 1.5 or later.

Add ex_cldr_dates_time as a dependency to your mix project:

defp deps do
  [
    {:ex_cldr_units, "~> 0.1.3"}
  ]
end

then retrieve ex_cldr_units from hex:

mix deps.get
mix deps.compile

cldr_units's People

Contributors

kipcole9 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.