{"id":32184440,"url":"https://github.com/cgdeboer/vectoround","last_synced_at":"2025-10-21T23:48:46.730Z","repository":{"id":62435051,"uuid":"171038934","full_name":"cgdeboer/vectoround","owner":"cgdeboer","description":"Sum-safe Rounding for Collections in Clojurescript","archived":false,"fork":false,"pushed_at":"2019-02-22T04:13:08.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T23:48:25.360Z","etag":null,"topics":["clojurescript","rounding"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cgdeboer.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-16T18:47:08.000Z","updated_at":"2019-02-22T04:13:10.000Z","dependencies_parsed_at":"2022-11-01T20:46:02.559Z","dependency_job_id":null,"html_url":"https://github.com/cgdeboer/vectoround","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cgdeboer/vectoround","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgdeboer%2Fvectoround","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgdeboer%2Fvectoround/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgdeboer%2Fvectoround/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgdeboer%2Fvectoround/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgdeboer","download_url":"https://codeload.github.com/cgdeboer/vectoround/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgdeboer%2Fvectoround/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280354178,"owners_count":26316400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["clojurescript","rounding"],"created_at":"2025-10-21T23:48:45.317Z","updated_at":"2025-10-21T23:48:46.723Z","avatar_url":"https://github.com/cgdeboer.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"Vectoround: Sum-safe Rounding for collections\n=============================================\n\n.. image:: https://travis-ci.org/cgdeboer/vectoround.svg?branch=master\n    :target: https://travis-ci.org/cgdeboer/vectoround\n\nLeinengen coordinates:\n\n.. image:: https://img.shields.io/clojars/v/vectoround.svg\n    :target: https://clojars.org/vectoround\n\nVectoround is a sum-safe rounding library for\ncollections (lists, vectors, sets, maps).\n\nExample Code:\n\n.. code-block:: clojure\n\n  (ns sample.core\n    (:require [vectoround.core :refer [saferound]])\n\n  (def pre-rounded-vectormap\n    [{:name \"foo\" :value 60.19012964572332}\n     {:name \"bar\" :value 15.428802458406679}\n     {:name \"baz\" :value 24.381067895870007}])\n\n  (saferound pre-rounded-vectormap 0 :value)\n\n  ;; =\u003e [{:name \"foo\", :value 60.0}\n  ;;     {:name \"bar\", :value 16.0}\n  ;;     {:name \"baz\", :value 24.0}]\n\n  ;; =\u003e original sum (100) is preserved.\n\n\nHow It Works\n---------------\nVectoround provides a function called :code:`saferound` that takes the\nfollowing 3 ordered inputs:\n\na collection (map, vector, list or set): a data structure.\n    A structure that contains floats to be rounded. e.g a vector of floats,\n    a map with float values, a vector of maps contains floats.\n\nplaces (int): Places for rounding.\n    Number of places each item in the set should be rounded to.\n\nfield (keyword, or nil):\n    if the collection is a list/vector of maps, else pass :code:`nil`\n\n\n    Vectoround uses the 'difference' strategy and seeks to minimize the\n    sum of the array of the differences between the original value and the\n    rounded value of each item in the collection. It will adjust the items\n    with the largest difference to preserve the sum.\n\nwill return :code:`nil` or the same data structure that was passed with the\nrounded values.\n\n\nFeature Support\n---------------\n\nVectoround definitely supports at least these collections.\n\n- `list` (either list of floats, or list of maps)\n- `vector` (either vector of floats, or vector of maps)\n- `map` (rounds the values)\n\n\nDocumentation\n-------------\n\nDocumentation beyond this readme not available.\n\n\nHow to Contribute\n-----------------\n\n#. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.\n#. Fork `the repository`_ on GitHub to start making your changes to the **master** branch (or branch off of it).\n#. Write a test which shows that the bug was fixed or that the feature works as expected.\n#. Send a pull request. Make sure to add yourself to AUTHORS_.\n\n.. _`the repository`: https://github.com/cgdeboer/vectoround\n.. _AUTHORS: https://github.com/cgdeboer/vectoround/blob/master/AUTHORS.rst\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgdeboer%2Fvectoround","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgdeboer%2Fvectoround","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgdeboer%2Fvectoround/lists"}