kip

kip

ex_cldr Core Team

Ex_money - feedback and request for comments

ex_money is a lib I maintain to provide functions on and serialisation of a structured money type. It is driven by the currency definitions in the Unicode CLDR as implemented by ex_cldr.

My aim to drive to a stable 1.0 release by the end of the year. By that time CLDR release 32 will be out and ex_money will have been in the wild for several months without - so far - any material public API changes.

This post is to solicit any feedback, suggestions, concerns or issues that could contribute to the packages evolution and to the goal of a stable and production standard 1.0 release by the end of the year.

The README gives a reasonable introduction to functions and motivations. The code is available on GitHub.

Feel free to respond here. Or perhaps more appropriately open an issue on Github.

Most Liked

kip

kip

ex_cldr Core Team

I would say the main difference is that ex_money is driven by the CLDR repository and therefore supports all defined 516 locales, all ISO4217 currencies; knows the correct rounding required for each currency (cash and transaction amounts) and knows how to format in a locale-specific way.

The second difference is the provision of an Ecto composite type for Postgres (and a lesser implementation for MySQL) to aid serialisation and preserve precision.

Of course none of these things may matter for a given application.

LostKobrakai

LostKobrakai

I’ve already expressed this on github, but I really really like the approach of going from a canonical source like cldr to implementing a money library. I’ve seen money libs include some json file with currencies and their iso codes and number of decimal places, but this only works for as long you won’t need to access this data elsewhere in your application. This is different with ex_money. I can explicitly include ex_cldr in my project and use the underlying data just like ex_money does and there’s no accidental miss-match or the attempt to keep multiple sources in sync.

LostKobrakai

LostKobrakai

There are few advantages:

  • ex_money does support different currencies to be stored with it’s ecto.type.
  • ex_money does support stringification based on the user locale a.k.a. “$ 1,000.00” vs “1.000,00 $”

Where Next?

Popular in Announcing Top

gabrielpoca
Hello everyone! I want to share with you something that I’m really proud of: https://stillstatic.io/ Still is a static site builder for...
New
mspanc
I am pleased to announce an initial release of the Membrane Framework - an Elixir-based framework with special focus on processing multim...
New
devonestes
Introducing assertions, the library that helps you write really great test assertions! GitHub: GitHub - devonestes/assertions: Helpful a...
New
zorbash
I created Kitto a framework for dashboards inspired by Dashing. The distributed characteristics of Elixir and the low memory footprint...
New
sbs
Only 650 LOC, wrote for fun :slight_smile: https://github.com/sunboshan/qrcode
New
Jskalc
Hi! Today, after a couple weeks of development I’ve released v0.1 of LiveVue. It’s a seamless integration of Vue and Phoenix LiveView, i...
New
fuelen
Hey folks! Want to present a toolkit for writing command-line user interfaces. It provides a convenient interface for colorizing text...
New
archan937
It is a well-know topic within the Elixir community: “To mock or not to mock? :)” Every alchemist probably has his / her own opinion con...
New
benlime
LiveMotion enables high performance animations declared on the server and run on the client. As a follow up to my previous thread A libr...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30877 112
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New

We're in Beta

About us Mission Statement