Title: Numeric table columns in report should be aligned right · Issue #975 · phpbench/phpbench · GitHub
Open Graph Title: Numeric table columns in report should be aligned right · Issue #975 · phpbench/phpbench
X Title: Numeric table columns in report should be aligned right · Issue #975 · phpbench/phpbench
Description: In a cli report table, to properly compare numbers, columns with numbers should: be aligned right (\STR_PAD_LEFT). use the same measuring unit (e.g. not ms in one record, but µs in another record). ideally, a unit should be used where al...
Open Graph Description: In a cli report table, to properly compare numbers, columns with numbers should: be aligned right (\STR_PAD_LEFT). use the same measuring unit (e.g. not ms in one record, but µs in another record)....
X Description: In a cli report table, to properly compare numbers, columns with numbers should: be aligned right (\STR_PAD_LEFT). use the same measuring unit (e.g. not ms in one record, but µs in another record)....
Opengraph URL: https://github.com/phpbench/phpbench/issues/975
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Numeric table columns in report should be aligned right","articleBody":"In a cli report table, to properly compare numbers, columns with numbers should:\r\n- be aligned right (`\\STR_PAD_LEFT`).\r\n- use the same measuring unit (e.g. not `ms` in one record, but `µs` in another record).\r\n- ideally, a unit should be used where all values are > 1, so that big numbers visually stick out with additional digits to the left.\r\n (for these last points I currently use ` --mode=throughput --time-unit=s` as cli parameters)\r\n\r\nFor the first point, I found that the following addition in `TableRenderer::render()` has the desired effect for the main table:\r\n\r\n```php\r\n $style = (new TableStyle())->setPadType(\\STR_PAD_LEFT);\r\n $nColumns = \\count($object->columnNames());\r\n for ($iCol = 2; $iCol \u003c $nColumns; ++$iCol) {\r\n $consoleTable->setColumnStyle($iCol, $style);\r\n }\r\n```\r\n\r\nHowever, this is obviously the wrong place to do this.\r\nI am hard-coding the rule that every column except the first two should be aligned right, which is true for the final overview table but not universally for every table.\r\n\r\nWhat the code example shows is that the symfony console table component _can_ align numbers right.","author":{"url":"https://github.com/donquixote","@type":"Person","name":"donquixote"},"datePublished":"2022-01-02T03:59:06Z","url":"https://github.com/phpbench/phpbench/issues/975"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fc8ecaa3-6b67-cc92-bae0-1dbcd842c3f4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD2A:D9868:11934F9:18B2E57:6B04515A |
| html-safe-nonce | 687dfaeb7ca52a98d3a5d691279da8149404bb9624bb152241bf190f65729e54 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDJBOkQ5ODY4OjExOTM0Rjk6MThCMkU1Nzo2QjA0NTE1QSIsInZpc2l0b3JfaWQiOiI5MDc0OTA4NDc1MzYwMDM5MjU4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9f41482ed3c7bcda1c026ba8bf712d4b54205a22a09fa965778107462985096b |
| hovercard-subject-tag | issue:1091945458 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/phpbench/phpbench/975/issue_layout |
| twitter:image | https://opengraph.githubassets.com/86bc021a67f0a5db662b3978671ac4fbe89960a4c285d0da15b8e1ca3d6d31fd/phpbench/phpbench/issues/975 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/86bc021a67f0a5db662b3978671ac4fbe89960a4c285d0da15b8e1ca3d6d31fd/phpbench/phpbench/issues/975 |
| og:image:alt | In a cli report table, to properly compare numbers, columns with numbers should: be aligned right (\STR_PAD_LEFT). use the same measuring unit (e.g. not ms in one record, but µs in another record).... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | donquixote |
| hostname | github.com |
| expected-hostname | github.com |
| None | 002aa6b95ffa730b0aec436a5c383f536ad677284e60056037fb120afe37b730 |
| turbo-cache-control | no-preview |
| go-import | github.com/phpbench/phpbench git https://github.com/phpbench/phpbench.git |
| octolytics-dimension-user_id | 12785153 |
| octolytics-dimension-user_login | phpbench |
| octolytics-dimension-repository_id | 34982189 |
| octolytics-dimension-repository_nwo | phpbench/phpbench |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 34982189 |
| octolytics-dimension-repository_network_root_nwo | phpbench/phpbench |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 059f24c781e3a0d7df3f27a97da0e93fab06ae39 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width