{"id":37114974,"url":"https://github.com/pyed/go-humanize","last_synced_at":"2026-01-14T13:30:33.312Z","repository":{"id":57524668,"uuid":"59740657","full_name":"pyed/go-humanize","owner":"pyed","description":"Go Humans! (formatters for units to human friendly sizes)","archived":false,"fork":true,"pushed_at":"2017-05-01T02:02:44.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T05:09:54.209Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/dustin/go-humanize","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dustin/go-humanize","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyed.png","metadata":{"files":{"readme":"README.markdown","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}},"created_at":"2016-05-26T10:11:53.000Z","updated_at":"2024-06-20T05:09:54.210Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pyed/go-humanize","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pyed/go-humanize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyed%2Fgo-humanize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyed%2Fgo-humanize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyed%2Fgo-humanize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyed%2Fgo-humanize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyed","download_url":"https://codeload.github.com/pyed/go-humanize/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyed%2Fgo-humanize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28421212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":"2026-01-14T13:30:32.780Z","updated_at":"2026-01-14T13:30:33.289Z","avatar_url":"https://github.com/pyed.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Humane Units [![Build Status](https://travis-ci.org/dustin/go-humanize.svg?branch=master)](https://travis-ci.org/dustin/go-humanize) [![GoDoc](https://godoc.org/github.com/dustin/go-humanize?status.svg)](https://godoc.org/github.com/dustin/go-humanize)\n\nJust a few functions for helping humanize times and sizes.\n\n`go get` it as `github.com/dustin/go-humanize`, import it as\n`\"github.com/dustin/go-humanize\"`, use it as `humanize`.\n\nSee [godoc](https://godoc.org/github.com/dustin/go-humanize) for\ncomplete documentation.\n\n## Sizes\n\nThis lets you take numbers like `82854982` and convert them to useful\nstrings like, `83 MB` or `79 MiB` (whichever you prefer).\n\nExample:\n\n```go\nfmt.Printf(\"That file is %s.\", humanize.Bytes(82854982)) // That file is 83 MB.\n```\n\n## Times\n\nThis lets you take a `time.Time` and spit it out in relative terms.\nFor example, `12 seconds ago` or `3 days from now`.\n\nExample:\n\n```go\nfmt.Printf(\"This was touched %s.\", humanize.Time(someTimeInstance)) // This was touched 7 hours ago.\n```\n\nThanks to Kyle Lemons for the time implementation from an IRC\nconversation one day. It's pretty neat.\n\n## Ordinals\n\nFrom a [mailing list discussion][odisc] where a user wanted to be able\nto label ordinals.\n\n    0 -\u003e 0th\n    1 -\u003e 1st\n    2 -\u003e 2nd\n    3 -\u003e 3rd\n    4 -\u003e 4th\n    [...]\n\nExample:\n\n```go\nfmt.Printf(\"You're my %s best friend.\", humanize.Ordinal(193)) // You are my 193rd best friend.\n```\n\n## Commas\n\nWant to shove commas into numbers? Be my guest.\n\n    0 -\u003e 0\n    100 -\u003e 100\n    1000 -\u003e 1,000\n    1000000000 -\u003e 1,000,000,000\n    -100000 -\u003e -100,000\n\nExample:\n\n```go\nfmt.Printf(\"You owe $%s.\\n\", humanize.Comma(6582491)) // You owe $6,582,491.\n```\n\n## Ftoa\n\nNicer float64 formatter that removes trailing zeros.\n\n```go\nfmt.Printf(\"%f\", 2.24)                // 2.240000\nfmt.Printf(\"%s\", humanize.Ftoa(2.24)) // 2.24\nfmt.Printf(\"%f\", 2.0)                 // 2.000000\nfmt.Printf(\"%s\", humanize.Ftoa(2.0))  // 2\n```\n\n## SI notation\n\nFormat numbers with [SI notation][sinotation].\n\nExample:\n\n```go\nhumanize.SI(0.00000000223, \"M\") // 2.23 nM\n```\n\n[odisc]: https://groups.google.com/d/topic/golang-nuts/l8NhI74jl-4/discussion\n[sinotation]: http://en.wikipedia.org/wiki/Metric_prefix\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyed%2Fgo-humanize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyed%2Fgo-humanize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyed%2Fgo-humanize/lists"}