{"id":50506594,"url":"https://github.com/gopherlibs/humanize","last_synced_at":"2026-06-02T16:31:35.505Z","repository":{"id":356788982,"uuid":"1234041164","full_name":"gopherlibs/humanize","owner":"gopherlibs","description":"Formatters for units to human friendly sizes.","archived":false,"fork":false,"pushed_at":"2026-06-01T04:23:04.000Z","size":151,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"trunk","last_synced_at":"2026-06-01T06:22:41.788Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/gopherlibs.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":"SECURITY.md","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":"2026-05-09T17:12:40.000Z","updated_at":"2026-06-01T04:22:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gopherlibs/humanize","commit_stats":null,"previous_names":["gopherlibs/humanize"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gopherlibs/humanize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopherlibs%2Fhumanize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopherlibs%2Fhumanize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopherlibs%2Fhumanize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopherlibs%2Fhumanize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gopherlibs","download_url":"https://codeload.github.com/gopherlibs/humanize/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopherlibs%2Fhumanize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33831623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"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":[],"created_at":"2026-06-02T16:31:34.933Z","updated_at":"2026-06-02T16:31:35.500Z","avatar_url":"https://github.com/gopherlibs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GopherLibs =\u003e Humanize [![Go Reference][gopkg]](https://pkg.go.dev/github.com/gopherlibs/humanize) [![Go Report Card](https://goreportcard.com/badge/github.com/gopherlibs/humanize)](https://goreportcard.com/report/github.com/gopherlibs/humanize) [![Software License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/gopherlibs/humanize/trunk/LICENSE)\n\n*This project is a hard fork of `github.com/dustin/go-humanize`. The project continues here, with maintenance and potentially new features.*\n\n`Humanize` is a Go package to format various units and words into human friendly terms.\n\n\n## Table of Contents\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Development](#development)\n- [Migrating](#migrating)\n- [Credits](#credits)\n\n\n## Requirements\n\n- The minimum Go version supported is v1.24.\n\n\n## Installation\n\nRun `go get github.com/gopherlibs/humanize/humanize` in your project directory.\nThen you can import the package in whatever files you use it in.\n\n\n## Usage\n\nThis module is fairly simple. Most formatters are functions of the package.\nSimply determine the conversion you need and find the corresponding function.\n\nHere are some examples.\n\n### Sizes\n\nThis lets you take numbers like `82854982` and convert them to useful strings like, `83 MB` or `79 MiB` (whichever you prefer).\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\n```go\nfmt.Printf(\"This was touched %s.\", humanize.Time(someTimeInstance)) // This was touched 7 hours ago.\n```\n\n### Ordinals\n\nThis lets you 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\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\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](http://en.wikipedia.org/wiki/Metric_prefix).\n\n```go\nhumanize.SI(0.00000000223, \"M\") // 2.23 nM\n```\n\n### English-specific functions\n\nThe following functions are in the `github.com/gopherlibs/humanize/humanize/english` package.\n\n#### Plurals\nSimple English pluralization\n\n```go\nenglish.PluralWord(1, \"object\", \"\") // object\nenglish.PluralWord(42, \"object\", \"\") // objects\nenglish.PluralWord(2, \"bus\", \"\") // buses\nenglish.PluralWord(99, \"locus\", \"loci\") // loci\n\nenglish.Plural(1, \"object\", \"\") // 1 object\nenglish.Plural(42, \"object\", \"\") // 42 objects\nenglish.Plural(2, \"bus\", \"\") // 2 buses\nenglish.Plural(99, \"locus\", \"loci\") // 99 loci\n```\n\n#### Word series\nFormat comma-separated words lists with conjuctions:\n\n```go\nenglish.WordSeries([]string{\"foo\"}, \"and\") // foo\nenglish.WordSeries([]string{\"foo\", \"bar\"}, \"and\") // foo and bar\nenglish.WordSeries([]string{\"foo\", \"bar\", \"baz\"}, \"and\") // foo, bar and baz\n\nenglish.OxfordWordSeries([]string{\"foo\", \"bar\", \"baz\"}, \"and\") // foo, bar, and baz\n```\n\nSee the [Go Pkg Docs][gopkg] for complete documentation.\n\n\n## Development\n\nThis library is written and tested with Go v1.24+ in mind.\n`go fmt` is your friend.\nPlease feel free to open Issues and PRs are you see fit.\nAny PR that requires a good amount of work or is a significant change, it would be best to open an Issue to discuss the change first.\n\n\n## Migrating\n\nAre you migrating from `github.com/dustin/go-humanize`?\nIt isn't complicated.\nRun through the [installation](#installation) steps above.\nIn the import statements for each file, replace `github.com/dustin/go-humanize` with `github.com/gopherlibs/humanize/humanize`.\nThat should be it.\n\n\n## Credits\n\nThis module is maintained by Ricardo N Feliciano (FelicianoTech).\nThis repository is licensed under the MIT license.\nThis repo's license can be found [here](./LICENSE).\n\nThis module is a hard fork of [dustin/go-humaize](https://github.com/dustin/go-humanize).\nThat project seems to no longer be maintained.\nThis project will continue where that one left off, including the original git history.\n\n\n\n\n\n[gopkg]: https://pkg.go.dev/badge/github.com/gopherlibs/humanize.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopherlibs%2Fhumanize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgopherlibs%2Fhumanize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopherlibs%2Fhumanize/lists"}