kip

kip

ex_cldr Core Team

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.

Showing Posts 1 to 6

svilen

svilen

Author of Concurrent Data Processing in Elixir

Thank you for the great work, @kip! This would be a good fit for an upcoming feature we’ll be working on at Heresy and I’ll probably put it to use in the next few weeks.

Do you see any breaking changes coming up in 1.0? If possible, could you provide some notes how to prepare for them, if we adopt the package before 1.0 is released? A migration guide would be extremely useful. Thanks!

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.

kip

kip OP

ex_cldr Core Team

svilen, no planned breaking changes. My post was to solicit any feedback or requests that would potentially require a breaking change - none identified so far.

There has been a good request on GitHub for the exchange rate mechanism to allow for a “rates effective date” rather than only use “latest rates”. But that can be done backwards compatibly.

Otherwise the only plan is to make the configuration conform to the init callback mechanism like Ecto and Phoenix (its nearly there now).

Lastly, version 1.0 will be based upon CLDR version 32 which comes out next week. It doesn’t appear to change anything that would affect ex_money. The only currency change it to add the code for STN (SAO TOME AND PRINCIPE) which will be valid as of 2018-09-01. Not a big change for most apps I would say :slight_smile:

yurko

yurko

We’ve used money (money | Hex / GitHub - elixirmoney/money: Elixir library for working with Money safer, easier, and fun... Is an interpretation of the Fowler's Money pattern in fun.prog. · GitHub) and it worked just fine, it’s also very similar to money libs we used in other languages.

I’ve looked at the readme and see that there are many similarities in terms of the API. Is there a particular reason to choose ex_money over money? Would it be about the exchange rates service?

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 $”
kip

kip OP

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.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 12366 136
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
kip
I’ll shortly be launching Text, a nascent text analysis library. Current functionality In this early version (not ready for prime time) ...
New

Other Trending Topics Top

budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
Null-logic-0
What IDE or editor are you using for Elixir development? Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews