Skip to content

Commit

Permalink
✨ remove "more than X charts" verbiage from key indicator collection
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesau committed Nov 8, 2024
1 parent 1dbd083 commit 358e068
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
4 changes: 0 additions & 4 deletions packages/@ourworldindata/utils/src/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1870,10 +1870,6 @@ export function isElementHidden(element: Element | null): boolean {
return isElementHidden(element.parentElement)
}

export function roundDownToNearestHundred(value: number): number {
return Math.floor(value / 100) * 100
}

const commafyFormatter = lazy(() => new Intl.NumberFormat("en-US"))
/**
* Example: 12000 -> "12,000"
Expand Down
1 change: 0 additions & 1 deletion packages/@ourworldindata/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export {
cartesian,
removeTrailingParenthetical,
isElementHidden,
roundDownToNearestHundred,
commafyNumber,
isFiniteWithGuard,
createTagGraph,
Expand Down
17 changes: 4 additions & 13 deletions site/gdocs/components/KeyIndicatorCollection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ import {
EnrichedBlockKeyIndicator,
GrapherTabOption,
} from "@ourworldindata/types"
import {
Url,
urlToSlug,
roundDownToNearestHundred,
commafyNumber,
} from "@ourworldindata/utils"
import { Url, urlToSlug, commafyNumber } from "@ourworldindata/utils"

import { useLinkedChart, useLinkedIndicator } from "../utils.js"
import KeyIndicator from "./KeyIndicator.js"
Expand Down Expand Up @@ -60,13 +55,9 @@ export default function KeyIndicatorCollection({
<h2 className="h2-bold">Explore our data</h2>
{homepageMetadata?.chartCount ? (
<p className="body-2-regular">
Featured data from our collection of more than{" "}
{commafyNumber(
roundDownToNearestHundred(
homepageMetadata.chartCount
)
)}{" "}
interactive charts.
Featured data from our collection of{" "}
{commafyNumber(homepageMetadata.chartCount)} interactive
charts.
</p>
) : (
<p className="body-2-regular">
Expand Down

0 comments on commit 358e068

Please sign in to comment.