{"id":18182976,"url":"https://github.com/horvathandris/bigdecimal","last_synced_at":"2026-01-12T08:46:03.163Z","repository":{"id":257899256,"uuid":"868064020","full_name":"horvathandris/bigdecimal","owner":"horvathandris","description":"Arbitrary precision decimal arithmetic for Gleam","archived":false,"fork":false,"pushed_at":"2026-01-01T16:41:48.000Z","size":75,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-06T22:27:16.142Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Gleam","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/horvathandris.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-05T11:37:36.000Z","updated_at":"2026-01-01T16:41:19.000Z","dependencies_parsed_at":"2026-01-02T03:06:07.378Z","dependency_job_id":null,"html_url":"https://github.com/horvathandris/bigdecimal","commit_stats":null,"previous_names":["horvathandris/bigdecimal"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/horvathandris/bigdecimal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horvathandris%2Fbigdecimal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horvathandris%2Fbigdecimal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horvathandris%2Fbigdecimal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horvathandris%2Fbigdecimal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/horvathandris","download_url":"https://codeload.github.com/horvathandris/bigdecimal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horvathandris%2Fbigdecimal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2024-11-02T20:00:25.832Z","updated_at":"2026-01-12T08:46:03.158Z","avatar_url":"https://github.com/horvathandris.png","language":"Gleam","funding_links":[],"categories":["Packages"],"sub_categories":["Numbers"],"readme":"# :b: bigdecimal\n\n[![Package Version](https://img.shields.io/hexpm/v/bigdecimal)](https://hex.pm/packages/bigdecimal)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/bigdecimal/)\n![Erlang Target](https://img.shields.io/badge/target-erlang-A90433)\n![JavaScript Target](https://img.shields.io/badge/target-javascript-F7E02A)\n\nA library for [arbitrary precision decimal arithmetic](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic) in Gleam.\n\nThis library builds on the excellent [bigi](https://hex.pm/packages/bigi) library.\nA `BigDecimal` consists of an arbitrary precision integer unscaled value of type `bigi.Bigint`\nand an integer scale of built-in type `Int` (arbitrary precision on the Erlang target, bound between\n[Number.MIN_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER)\nand [Number.MAX_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\non the JavaScript target). If zero or positive, the scale is the number of digits to the right of\nthe decimal point. If negative, the unscaled value of the number is multiplied by ten to the power\nof the negation of the scale. The value of the number represented by the `BigDecimal` is therefore\nunscaled_value × 10\u003csup\u003e-scale\u003c/sup\u003e.\n\n## Usage\n\n```sh\ngleam add bigdecimal@1\n```\n\n```gleam\nimport bigdecimal\n\npub fn main() {\n  let assert Ok(number) = bigdecimal.from_string(\"12.00340\")\n\n  bigdecimal.scale(of: number) // 5\n\n  bigdecimal.unscaled_value(of: number) // 1_200_340\n}\n```\n\nFurther documentation can be found at \u003chttps://hexdocs.pm/bigdecimal\u003e.\n\n## Development\n\nThe library supports all targets and runtimes. To do a matrix run of the test suite, run:\n\n```sh\n./scripts/matrix-test.sh\n```\n\n## TODO\n\n- [ ] square root\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhorvathandris%2Fbigdecimal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhorvathandris%2Fbigdecimal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhorvathandris%2Fbigdecimal/lists"}