{"id":16949067,"url":"https://github.com/jackc/numfmt","last_synced_at":"2025-04-11T20:20:22.472Z","repository":{"id":57564959,"uuid":"336642227","full_name":"jackc/numfmt","owner":"jackc","description":"Number formatting in Go","archived":false,"fork":false,"pushed_at":"2021-02-09T20:11:00.000Z","size":25,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T16:15:29.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jackc.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}},"created_at":"2021-02-06T21:40:03.000Z","updated_at":"2022-11-03T21:42:14.000Z","dependencies_parsed_at":"2022-09-18T04:51:59.380Z","dependency_job_id":null,"html_url":"https://github.com/jackc/numfmt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fnumfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fnumfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fnumfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fnumfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackc","download_url":"https://codeload.github.com/jackc/numfmt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248473079,"owners_count":21109629,"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","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-10-13T21:53:04.353Z","updated_at":"2025-04-11T20:20:22.438Z","avatar_url":"https://github.com/jackc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/jackc/numfmt.svg)](https://pkg.go.dev/github.com/jackc/numfmt)\n![CI](https://github.com/jackc/numfmt/workflows/CI/badge.svg)\n\n# numfmt\n\n`numfmt` is a number formatting package for Go.\n\n## Features\n\n* Rounding to N decimal places\n* Always display minimum of N decimal places\n* Configurable thousands separators\n* Scaling for percentage formatting\n* Format negative values differently for correct currency output like `-$12.34` or `(12.34)`\n* Easy to use with `text/template` and `html/template`\n\n## Examples\n\nUse directly from Go:\n\n```go\nf := \u0026numfmt.Formatter{\n  NegativeTemplate: \"(n)\",\n  MinDecimalPlaces: 2,\n}\nf.Format(\"-1234\") // =\u003e \"(1,234.00)\"\n```\n\nOr in use in `text/template`:\n\n```\n{{numfmt \"1234.5\"}} =\u003e \"1,234.5\"\n{{numfmt \"GroupSeparator\" \" \" \"DecimalSeparator\" \",\" \"1234.5\"}} =\u003e \"1 234,5\"\n```\n\nSee the [documentation](https://pkg.go.dev/github.com/jackc/numfmt) for more examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackc%2Fnumfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackc%2Fnumfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackc%2Fnumfmt/lists"}