{"name":"@deckyard/money","description":"Exact currency amounts in minor units: ISO 4217 currencies, rounding, allocation and exchange","versions":{"0.1.0":{"version":"0.1.0","kind":"git","url":"https://github.com/deckyard/deck-money.git","ref":"0.1.0","commit":"53b620c3ff27803fde6818931b99387a85d38872","checksum":"","yanked":false,"license":"LGPL-3.0-only","requires":{},"engines":{"jennifer":"\u003e=0.26.0","jennifer-tiny":"\u003e=0.26.0"},"capabilities":[],"keywords":["money","currency","iso4217","decimal","rounding"],"description":"Exact currency amounts in minor units: ISO 4217 currencies, rounding, allocation and exchange","publishedAt":"1793739602","repoId":1444769098,"repoOwnerId":346943577,"repoOwner":"deckyard"}},"readme":"# @deckyard/money\n\n[![test](https://github.com/deckyard/deck-money/actions/workflows/test.yml/badge.svg)](https://github.com/deckyard/deck-money/actions/workflows/test.yml)\n[![Documentation](https://img.shields.io/badge/docs-github%20pages-blue)](https://deckyard.github.io/deck-money/)\n[![release](https://img.shields.io/github/v/release/deckyard/deck-money)](https://github.com/deckyard/deck-money/releases/latest)\n\nExact currency amounts for [Jennifer](https://jennifer-lang.dev/), on the\n`decimal` library. An amount is an `int` of minor units with its ISO 4217\ncode, so it is exact, compares with `==` and stores as a plain number.\nMultiplying, dividing and exchanging round to whole minor units in the mode\nthe caller names; `allocate` splits an amount without losing or creating a\ncent; amounts of different currencies never mix.\n\n**[Documentation](https://deckyard.github.io/deck-money/)**\n\n## Install\n\n```sh\njvc add @deckyard/money\n```\n\nThis vendors the deck to `vendor/\u003cscope\u003e/money/`. Without `jvc`, unpack the\n`src/` subtree of a release archive (`\u003cscope\u003e-money-\u003cversion\u003e.tar.gz`) there.\n\n## Usage\n\n```jennifer\nimport \"@deckyard/money/\" as money;\n\ndef net as money.Money init money.parse(\"19.99\", \"EUR\");\ndef gross as money.Money init money.multiply($net, \"1.19\", \"half-up\");\nio.printf(\"%s EUR\\n\", money.format($gross));   # 23.79 EUR\n\nfor (def part in money.allocate($gross, [\"1\", \"1\", \"1\"])) {\n    io.printf(\"%s \", money.format($part));      # 7.93 7.93 7.93\n}\n```\n\n## Requirements\n\nJennifer 0.26.0 or newer, `jennifer` or `jennifer-tiny`. No capabilities:\nthe deck is pure computation.\n\n## Development\n\n```sh\ntools/check-all.sh                   # the full gate, as CI runs it\njennifer test src/money_test.j       # the test overlay\ntools/gen-currencies.sh              # refresh the ISO 4217 table\ntools/check-docs.sh                  # docs against the code\ntools/pack.sh dist                   # build the release archive\n```\n\n## Licence\n\nLGPL-3.0-only, see [LICENSE](LICENSE). Copyright (C) 2026 mplx \u0026lt;mplx@jennifer-lang.dev\u0026gt;.\n\n`tools/check-headers.sh` checks every source file's SPDX header against\n`deck.toml`.\n"}