{"id":21985597,"url":"https://github.com/ickshonpe/math_type_display_hack","last_synced_at":"2026-05-18T00:33:28.409Z","repository":{"id":107186653,"uuid":"502033590","full_name":"ickshonpe/math_type_display_hack","owner":"ickshonpe","description":"compact math type display","archived":false,"fork":false,"pushed_at":"2022-06-12T21:03:42.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-14T04:53:08.889Z","etag":null,"topics":["bevy","math"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/ickshonpe.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}},"created_at":"2022-06-10T12:23:49.000Z","updated_at":"2022-06-11T23:55:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"d2a1f520-c096-408c-92c5-6412a2a405a0","html_url":"https://github.com/ickshonpe/math_type_display_hack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ickshonpe/math_type_display_hack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickshonpe%2Fmath_type_display_hack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickshonpe%2Fmath_type_display_hack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickshonpe%2Fmath_type_display_hack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickshonpe%2Fmath_type_display_hack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ickshonpe","download_url":"https://codeload.github.com/ickshonpe/math_type_display_hack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickshonpe%2Fmath_type_display_hack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33160488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"ssl_error","status_checked_at":"2026-05-17T22:39:10.741Z","response_time":107,"last_error":"SSL_read: 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":["bevy","math"],"created_at":"2024-11-29T18:14:07.694Z","updated_at":"2026-05-18T00:33:28.403Z","avatar_url":"https://github.com/ickshonpe.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# math type display hack\n\nBashed this together because Bevy doesn't implement ```Display``` for its math types like ```Transform``` and ```GlobalTransform```.\n\n## examples\n\n### With ```Debug```:\n```rust\nlet translation = 2.0_f32.sqrt() * Vec3::X;\nlet tf = Transform {\n    translation,\n    ..Default::default()\n};\nprintln!(\"{:?}\", translation);\nprintln!(\"{:.1?}\", translation);\nprintln!(\"{:?}\", translation.as_ref());\nprintln!(\"{:.1?}\", translation.as_ref());\nprintln!(\"{:?}\", tf);\nprintln!(\"{:.1?}\", tf);\n```\nwhich outputs\n```\nVec3(1.4142135, 0.0, 0.0)\nVec3(1.4, 0.0, 0.0)\n[1.4142135, 0.0, 0.0]\n[1.4, 0.0, 0.0]\nTransform { translation: Vec3(1.4142135, 0.0, 0.0), rotation: Quat(0.0, 0.0, 0.0, 1.0), scale: Vec3(1.0, 1.0, 1.0) }\nTransform { translation: Vec3(1.4, 0.0, 0.0), rotation: Quat(0.0, 0.0, 0.0, 1.0), scale: Vec3(1.0, 1.0, 1.0) }\n```\n\n### With ```math_type_display_hack```:\n```rust\nuse math_type_display_hack::*;\n\nlet translation = 2.0_f32.sqrt() * Vec3::X;\nlet tf = Transform {\n    translation,\n    ..Default::default()\n};\nprintln!(\"{}\", translation.display());\nprintln!(\"{:.1}\", translation.display());\nprintln!(\"{}\", tf.display());\nprintln!(\"{:.1}\", tf.display());\n```\nwhich outputs\n```\n[1.4142135, 0.0, 0.0]\n[1.4, 0.0, 0.0]\n{ [1.4142135, 0.0, 0.0], [0.0, 0.0, 0.0, 1.0], [1.0, 1.0, 1.0] }\n{ [1.4, 0.0, 0.0], [0.0, 0.0, 0.0, 1.0], [1.0, 1.0, 1.0] }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fickshonpe%2Fmath_type_display_hack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fickshonpe%2Fmath_type_display_hack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fickshonpe%2Fmath_type_display_hack/lists"}