🀌 Number formatter plugin

2023-01-12 21.50.15

  1. @heythere asked for it.
  2. @pablo.heredia reminded me of a Fireship.io video
  3. I put something together :point_right: demo


Instructions

  1. slap this baby on the page
  2. feed it some numerical input
  3. take its output (text) and show it to the world

Optional
4. if you got that need for speed, add @eli’s 1-T Input Watcher.

15 Likes

You can now enter locales.

2023-01-12 22.45.39

2 Likes

man this plugin is pure gold!!!

1 Like

[1.4.0] β€” 2026-03-06

Enhanced: Number Formatter element

New formatting fields:

  • Style β€” choose between decimal, currency, percent, or unit
  • Notation β€” standard, compact, scientific, or engineering
  • Currency code β€” dynamic ISO 4217 code (e.g. USD, EUR, JPY)
  • Currency display β€” symbol ($), narrowSymbol, code (USD), or name (US dollars)
  • Unit β€” any supported unit (e.g. kilometer-per-hour, celsius, liter)
  • Unit display β€” long, short, or narrow

New precision fields:

  • Minimum fraction digits β€” force a minimum number of decimal places
  • Maximum fraction digits β€” cap the number of decimal places
  • Use grouping β€” control thousands separators (auto, always, or false)
  • Sign display β€” control +/- sign (auto, always, exceptZero, negative, never)

New output states:

  • Formatted number β€” clearer-named output (identical to legacy β€œCompacted number”)
  • Formatted parts (JSON) β€” formatToParts() output for custom rendering
  • Error message β€” surfaces formatting errors (bad currency code, invalid JSON, etc.)

Other improvements:

  • Full try/catch error handling
  • Reorganized fields with section labels for clarity
  • Updated captions and docs across all fields
  • Fully backward compatible β€” existing Compacted number state still works

[1.5.0] β€” 2026-03-06

New: :date: Date formatter element

A brand-new element wrapping Intl.DateTimeFormat β€” full locale-aware date and time formatting with zero external dependencies.

Two formatting modes:

  • Preset mode β€” quick formatting via dateStyle / timeStyle (full, long, medium, short)
  • Custom mode β€” granular control over individual components (weekday, year, month, day, hour, minute, second)

Core fields:

  • Date β€” the date to format
  • Locale β€” any BCP 47 locale (e.g. en-US, ja-JP, de-DE, ar-EG)
  • Time zone β€” any IANA timezone (e.g. America/New_York, Asia/Tokyo)

Preset mode fields:

  • Date style β€” full, long, medium, short, or none
  • Time style β€” full, long, medium, short, or none

Custom mode fields:

  • Weekday β€” long, short, narrow
  • Year β€” numeric, 2-digit
  • Month β€” numeric, 2-digit, long, short, narrow
  • Day β€” numeric, 2-digit
  • Hour / Minute / Second β€” numeric, 2-digit
  • Hour cycle β€” h12, h23, h24, h11, or auto

Date range formatting:

  • End date β€” when provided, uses formatRange() for natural ranges like β€œJan 5 – 10, 2026”

Advanced:

  • Advanced options (JSON) β€” raw JSON override for full Intl.DateTimeFormat access

Output states:

  • Formatted date β€” the formatted date string
  • Formatted range β€” the formatted range (empty if no end date)
  • Formatted parts (JSON) β€” formatToParts() output for custom rendering
  • Error message β€” empty on success, descriptive error on failure