comp.lang.ada
 help / color / mirror / Atom feed
* Currency Library for Ada?
@ 2023-04-13 14:17 A.J.
  2023-04-13 17:37 ` J-P. Rosen
  2023-05-04 17:59 ` Devin Rozsas
  0 siblings, 2 replies; 5+ messages in thread
From: A.J. @ 2023-04-13 14:17 UTC (permalink / raw)


Does anyone know if Ada has a currency library? Ideally one that includes the ISO 4217 currency standard?

I've seen currency referenced as examples in the Style Guide[1] and other documentation[2] but I'm having trouble searching for anything concrete (and googling "ada" and "currency" has not helped due to some unfortunately named crypto stuff).

I'm also interested in if there's any ada libraries for iso 3166 (country codes).

If none of this exists, that's fine, it just gives me a reason to build it out myself, but I don't want duplication of effort :)

AJ.

[1] https://ada-lang.io/docs/style-guide/Reusability/#guideline-16
[2] https://docs.adacore.com/live/wave/aunit/html/aunit_cb/aunit_cb/fixture.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Currency Library for Ada?
  2023-04-13 14:17 Currency Library for Ada? A.J.
@ 2023-04-13 17:37 ` J-P. Rosen
  2023-04-13 18:12   ` A.J.
  2023-05-04 17:59 ` Devin Rozsas
  1 sibling, 1 reply; 5+ messages in thread
From: J-P. Rosen @ 2023-04-13 17:37 UTC (permalink / raw)


Le 13/04/2023 à 16:17, A.J. a écrit :
> I'm also interested in if there's any ada libraries for iso 3166 (country codes).
It's a standard package, Ada.Locales

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
https://www.adalog.fr https://www.adacontrol.fr

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Currency Library for Ada?
  2023-04-13 17:37 ` J-P. Rosen
@ 2023-04-13 18:12   ` A.J.
  0 siblings, 0 replies; 5+ messages in thread
From: A.J. @ 2023-04-13 18:12 UTC (permalink / raw)


J-P. Rosen,

On Thursday, April 13, 2023 at 1:37:22 PM UTC-4, J-P. Rosen wrote:
> It's a standard package, Ada.Locales 

Thanks for finding that!  This looks like a good foundation for validating county codes, though it doesn't appear to contain an index of them, or expand into the 3-letter codes (e.g. USA vs US).  I was looking into the implementation, and the GNAT[1] runtime seems to be true to spec, while the Drake runtime[2] looks like it's expanding into closer to what I'm looking for with its iso639 tables [3].  I may be able to build on this set, though and use the existing structures.

AJ

[1] https://github.com/gcc-mirror/gcc/blob/master/gcc/ada/libgnat/a-locale.ads & https://github.com/gcc-mirror/gcc/blob/master/gcc/ada/libgnat/a-locale.adb
[2] https://github.com/ytomino/drake/blob/master/source/environment/a-locale.ads
[3] https://github.com/ytomino/drake/blob/master/source/environment/a-locale.adb#L60

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Currency Library for Ada?
  2023-04-13 14:17 Currency Library for Ada? A.J.
  2023-04-13 17:37 ` J-P. Rosen
@ 2023-05-04 17:59 ` Devin Rozsas
  2023-05-04 18:27   ` Devin Rozsas
  1 sibling, 1 reply; 5+ messages in thread
From: Devin Rozsas @ 2023-05-04 17:59 UTC (permalink / raw)


Em quinta-feira, 13 de abril de 2023 às 11:17:28 UTC-3, A.J. escreveu:
> Does anyone know if Ada has a currency library? Ideally one that includes the ISO 4217 currency standard? 
> 
> I've seen currency referenced as examples in the Style Guide[1] and other documentation[2] but I'm having trouble searching for anything concrete (and googling "ada" and "currency" has not helped due to some unfortunately named crypto stuff). 
> 
> I'm also interested in if there's any ada libraries for iso 3166 (country codes). 
> 
> If none of this exists, that's fine, it just gives me a reason to build it out myself, but I don't want duplication of effort :) 
> 
> AJ. 
> 
> [1] https://ada-lang.io/docs/style-guide/Reusability/#guideline-16 
> [2] https://docs.adacore.com/live/wave/aunit/html/aunit_cb/aunit_cb/fixture.html

I'm actually making something like this, but it isn't complete, and uses Lua scripts to handle different currencies (and formating).
It also has location support (country, state, city) and language support, including message translation (so the program can output stuff in the user's language). For this, TOML is used.

It uses Glottolog codes to identify languages, and FIFA codes for the countries.

I paused the development because I'm focusing on another project that has been causing me some headaches lately.
It's broken and cannot deliver what you want - as of now.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Currency Library for Ada?
  2023-05-04 17:59 ` Devin Rozsas
@ 2023-05-04 18:27   ` Devin Rozsas
  0 siblings, 0 replies; 5+ messages in thread
From: Devin Rozsas @ 2023-05-04 18:27 UTC (permalink / raw)


> I'm actually making something like this, but it isn't complete, and uses Lua scripts to handle different currencies (and formating). 

By the way, the code is here: https://sr.ht/~devin/Azurite-Ada/

Again, it's incomplete, and probably isn't exactly what you're looking for.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-04 18:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13 14:17 Currency Library for Ada? A.J.
2023-04-13 17:37 ` J-P. Rosen
2023-04-13 18:12   ` A.J.
2023-05-04 17:59 ` Devin Rozsas
2023-05-04 18:27   ` Devin Rozsas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox