Skip to content

Commit

Permalink
Change number presentation
Browse files Browse the repository at this point in the history
This makes the numbers more in line with how they are presented
elsewhere, as well as using shortened forms instead of “Thousand,
Million” etc
  • Loading branch information
pezholio committed Nov 5, 2024
1 parent 8ca6529 commit 1846ed6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def rows
text: content_item.document_type.humanize,
},
{
text: content_item.unique_pageviews ? number_to_human(content_item.unique_pageviews) : nil,
text: content_item.unique_pageviews ? number_to_human(content_item.unique_pageviews, format: "%n%u", precision: 3, significant: true, units: { thousand: "k", million: "m", billion: "b" }) : nil,
},
{
text: organisation_link(content_item),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def self.it_returns_unknown_user

assert_selector "tbody .govuk-table__cell", text: host_content_item.title
assert_selector "tbody .govuk-table__cell", text: host_content_item.document_type.humanize
assert_selector "tbody .govuk-table__cell", text: "1.2 Million"
assert_selector "tbody .govuk-table__cell", text: "1.2m"
assert_selector "tbody .govuk-table__cell", text: host_content_item.publishing_organisation["title"]
assert_selector "tbody .govuk-table__cell", text: "#{time_ago_in_words(host_content_item.last_edited_at)} ago by #{user.name}"
assert_link user.name, { href: "mailto:#{user.email}" }
Expand Down

0 comments on commit 1846ed6

Please sign in to comment.