{"id":3333,"date":"2026-11-28T16:09:47","date_gmt":"2026-11-28T16:09:47","guid":{"rendered":"https:\/\/danieldreitberg.com\/?p=3333"},"modified":"2026-11-28T16:09:47","modified_gmt":"2026-11-28T16:09:47","slug":"dr-ai-84a6394b36855deb97e8","status":"publish","type":"post","link":"https:\/\/danieldreitberg.com\/index.php\/2026\/11\/28\/dr-ai-84a6394b36855deb97e8\/","title":{"rendered":"Format Editorial Numbers Only After the Comparison"},"content":{"rendered":"<p>A story export shows two results, 2 and 10. The writing assistant lists 10 first because a previous step formatted the values as text, and the report sorted those strings. Choose the numeric order while values are still numbers, then give the display the labels readers should see.<\/p>\n<p>Reference: <a href=\"https:\/\/www.postgresql.org\/docs\/current\/functions-formatting.html\">PostgreSQL data-type formatting<\/a>. PostgreSQL describes formatting typed values for text output.<\/p>\n<h2>Align and Format Numbers<\/h2>\n<p>Keep a typed value for comparisons and calculations. If the report requires labels, apply a formatting function such as PostgreSQL to_char where suitable, and use the typed value for ordering rather than the label. Formatting might add leading characters, group separators or different decimal separators. None of those features is intended to define numeric order by itself. Agree on the precision and locale for readers, and keep the underlying value unchanged. Two different values can also produce the same displayed label after rounding.<\/p>\n<h2>Verify Consistency<\/h2>\n<p>Use a fictional table with numeric 2 and 10. Sort by the typed field and expect 2 before 10 in ascending order. Create a separate fixture with simple unpadded text labels; depending on the text ordering rules, sorting strings can put 10 before 2. Add two nearby decimal values that round to the same display string and verify that the output still follows the intended numeric order. For repeated identical numeric values, specify a separate tie-breaker if the reproduction of an exact sequence matters.<\/p>\n<p>Check that the export exposes the numeric field if another tool has to perform calculations. Give the assistant the label for writing and the value for checking, without making it reverse-engineer one from the other.<\/p>\n<p>Review the formatting policy again when a translation changes the expected number notation.<\/p>\n<p>If a format deliberately rounds or suppresses precision, tell editors what the label omits. A near tie may matter in the article even when the displayed examples look the same.<\/p>\n<p><!-- drai-run:84a6394b36855deb97e8 --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A formatted label looks human-friendly, but text sorting can change the sequence.<\/p>\n","protected":false},"author":5,"featured_media":3334,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/posts\/3333"}],"collection":[{"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/comments?post=3333"}],"version-history":[{"count":1,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/posts\/3333\/revisions"}],"predecessor-version":[{"id":3335,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/posts\/3333\/revisions\/3335"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/media\/3334"}],"wp:attachment":[{"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/media?parent=3333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/categories?post=3333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/tags?post=3333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}