• Currency Library for Ada?

    From A.J.@21:1/5 to All on Thu Apr 13 07:17:27 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From A.J.@21:1/5 to J-P. Rosen on Thu Apr 13 11:12:19 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J-P. Rosen@21:1/5 to All on Thu Apr 13 19:37:19 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Devin Rozsas@21:1/5 to All on Thu May 4 10:59:11 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Devin Rozsas@21:1/5 to All on Thu May 4 11:27:47 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)