{"id":13902335,"url":"https://github.com/tobiasschuerg/android-money","last_synced_at":"2026-03-07T22:01:03.497Z","repository":{"id":145075965,"uuid":"107321838","full_name":"tobiasschuerg/android-money","owner":"tobiasschuerg","description":"Simple money and currency converter library for android.","archived":false,"fork":false,"pushed_at":"2022-10-25T20:11:34.000Z","size":178,"stargazers_count":67,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-25T10:40:05.488Z","etag":null,"topics":["android","android-library","currency","currency-converter","currency-exchange-rates","hacktoberfest","kotlin","money"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tobiasschuerg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-10-17T20:45:28.000Z","updated_at":"2023-01-26T06:25:14.000Z","dependencies_parsed_at":"2024-02-02T18:50:45.508Z","dependency_job_id":null,"html_url":"https://github.com/tobiasschuerg/android-money","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/tobiasschuerg/android-money","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiasschuerg%2Fandroid-money","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiasschuerg%2Fandroid-money/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiasschuerg%2Fandroid-money/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiasschuerg%2Fandroid-money/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobiasschuerg","download_url":"https://codeload.github.com/tobiasschuerg/android-money/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiasschuerg%2Fandroid-money/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30233429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","currency","currency-converter","currency-exchange-rates","hacktoberfest","kotlin","money"],"created_at":"2024-08-06T22:01:06.522Z","updated_at":"2026-03-07T22:01:03.456Z","avatar_url":"https://github.com/tobiasschuerg.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"[![Release](https://jitpack.io/v/tobiasschuerg/android-money.svg)](https://jitpack.io/#tobiasschuerg/android-money)\n\n# kotlin-money\n\nSimple money and currency library for Kotlin/JVM.\n\n## Create Money\n```kotlin\nval euro = Currencies.EURO\nval usDollar = Currencies.USDOLLAR\n\nval savedMoney = Money(1358.03, euro)\nprintln(\"I saved $savedMoney\")\n```\n\u003e I saved 1.358,03 EUR\n\n## Convert Money\nDefine exchange rates explicitly and convert:\n```kotlin\nval eurToUsd = ExchangeRate(euro, usDollar, 1.09)\n\nval dollars = savedMoney.convertInto(eurToUsd)\nprintln(\"That's $dollars\")\n\n// Convert back using the inverse rate\nval backToEuros = dollars.convertInto(eurToUsd.inverse())\n```\n\n### Chain Exchange Rates\nCompose multiple rates into a single transitive rate:\n```kotlin\nval jpy = Currency(\"JPY\", \"Japanese Yen\")\nval eurToUsd = ExchangeRate(euro, usDollar, 1.10)\nval usdToJpy = ExchangeRate(usDollar, jpy, 150.0)\n\nval eurToJpy = eurToUsd.chain(usdToJpy) // EUR -\u003e JPY at 165.0\nval yen = Money(100, euro).convertInto(eurToJpy)\n```\n\n## Money Calculations\n\n### Arithmetics\nUse Kotlin operators (`+`, `-`, `*`, `/`):\n```kotlin\nval savings = Money(1337, euro)\nval bonus = Money(200, euro)\nval total = savings + bonus\nval half = total / 2\n```\n\n### Summing up / Average\n```kotlin\nval moneyList = MoneyList(usDollar)\nmoneyList.add(Money(100.01, usDollar))\nmoneyList.add(Money(1.27, usDollar))\nmoneyList.add(Money(20, usDollar))\nmoneyList.add(Money(13.37, usDollar))\nprintln(\"Sum: ${moneyList.sum()}\")\nprintln(\"Average: ${moneyList.average()}\")\n```\n\nOr use the extension function on any collection:\n```kotlin\nval total = listOf(money1, money2, money3).sum()\n```\n\n### Percentage\n```kotlin\nval price = Money(200, euro)\nval tax = price.percent(19)       // 38 EUR\nval tip = price.percent(7.5)      // 15 EUR\n```\n\n### Rounding\n```kotlin\nval precise = Money(12.3456, euro)\nval rounded = precise.rounded()               // 12.35 EUR (2 decimals, HALF_UP)\nval floored = precise.rounded(2, RoundingMode.FLOOR)  // 12.34 EUR\nval integer = precise.rounded(0)              // 12 EUR\n```\n\n### Unary Minus\n```kotlin\nval income = Money(500, euro)\nval expense = -income  // -500 EUR\n```\n\n### Money Range\nCheck if an amount falls within a budget:\n```kotlin\nval budget = Money(100, euro)..Money(500, euro)\nval price = Money(250, euro)\nif (price in budget) println(\"Within budget!\")\n```\n\n### Locale Formatting\n```kotlin\nval price = Money(1234.56, usDollar)\nprintln(price.format(Locale.US))       // $1,234.56\nprintln(price.format(Locale.GERMANY))  // 1.234,56 $\n```\n\n## Add Library\nStep 1. Add the JitPack repository to your build file:\n```kotlin\nrepositories {\n    maven { url = uri(\"https://jitpack.io\") }\n}\n```\nStep 2. Add the dependency:\n```kotlin\ndependencies {\n    implementation(\"com.github.tobiasschuerg:android-money:1.0.0\")\n}\n```\n\n## Breaking Changes in 1.0.0\n\nThis release converts the library from an Android library to a plain **Kotlin/JVM** library and introduces several breaking API changes.\n\n### Library is now Kotlin/JVM\nThe library no longer depends on the Android SDK. It can be used in any Kotlin/JVM project (Android, backend, desktop).\n\n### Currency no longer holds exchange rates\nPreviously, `Currency` bundled an exchange rate, making it ambiguous and hard to reuse:\n```kotlin\n// Before (0.x)\nval usd = Currency(\"USD\", \"US Dollar\", 1.09)\nval dollars = euros.convertInto(usd)\n```\n\nNow, `Currency` is a pure identity type. Exchange rates are modeled explicitly:\n```kotlin\n// After (1.0.0)\nval usd = Currency(\"USD\", \"US Dollar\")\nval eurToUsd = ExchangeRate(Currencies.EURO, usd, 1.09)\nval dollars = euros.convertInto(eurToUsd)\n```\n\n### compareTo requires same currency\n`Money.compareTo()` previously compared across currencies using implicit rates. It now requires both values to be in the same currency and throws `IllegalArgumentException` otherwise.\n\n### MoneyList no longer supports autoConvert\nThe `autoConvert` parameter has been removed. Convert money to the target currency before adding it to the list.\n\n### Removed APIs\n- `Currency.rate`, `Currency.conversionTo()`, `Currency.withRate()`\n- `Collection\u003cMoney\u003e.sum(currency)` (cross-currency sum)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobiasschuerg%2Fandroid-money","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobiasschuerg%2Fandroid-money","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobiasschuerg%2Fandroid-money/lists"}