Format numbers
Installation
SKILL.md
Format Numbers
When editing .tsx files, ensure all user-facing numbers are formatted using the formatNumber utility from @tryghost/shade.
Import
import {formatNumber} from '@tryghost/shade';
When to use formatNumber
Use formatNumber() when rendering any numeric value that is displayed to the user, including:
- Member counts, visitor counts, subscriber counts
- Email engagement metrics (opens, clicks, bounces)
- Revenue amounts (combine with
centsToDollars()for monetary values) - Post analytics (views, link clicks)
- Any count or quantity shown in UI