本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)75k · #2805

currency-formatting

できること

このスキルは、Webサイトが異なる国の人々に、お金、数字、日付をどう表示するかを確認します。複数の地域にサービスを提供するサイトを作る開発者向けです。

使う場面

  • ✓価格の記号や区切りが、国によって誤って表示されているとき。
  • ✓日付が、海外の人を混乱させる形式で表示されているとき。
  • ✓Webサイトに新しい言語や地域を追加するとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/currency-formatting/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/currency-formatting/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“他の国の訪問者にとって、私のサイトの価格が正しく表示されているか確認してもらえますか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、数字、価格、日付が手で書かれている箇所を探します。訪問者の言語を使い、ブラウザの組み込みの書式ツールを使うよう提案します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Use Intl APIs for currency, number, and date formatting

Number and currency formatting rules differ significantly across locales — a value formatted as "$1,234.56" in the US is written "1.234,56 $" in Germany and "¥1,235" in Japan. Hardcoded formatting causes incorrect display for international users and is expensive to maintain manually as you add locales.

Quick Reference

  • Never hardcode currency symbols or thousand separators like $ or comma
  • Use Intl.NumberFormat with the currency style for monetary values
  • Use Intl.DateTimeFormat for locale-aware date and time display
  • Pass the user locale explicitly rather than relying on the browser default
  • Use Intl.Collator and locale fallback chains for sorting and searching

Check

Identify all places in this codebase where numbers, currencies, or dates are formatted manually instead of using Intl.NumberFormat or Intl.DateTimeFormat. Also flag locale-sensitive sorting that uses plain string comparison instead of Intl.Collator and any formatter that lacks a fallback locale.

Fix

Replace manual number and currency formatting with Intl.NumberFormat and replace manual date formatting with Intl.DateTimeFormat, passing the user locale explicitly. Use Intl.Collator for locale-aware sorting and resolve a supported fallback locale when the requested locale is unavailable.

Explain

Explain why locale-aware formatting with Intl APIs is required for international applications, what goes wrong when formatting is hardcoded, and why sorting/searching should also use locale-aware comparison.

Code Review

Review utility functions and components that render numbers, prices, percentages, or dates. Flag any hardcoded currency symbols, separators, or date format strings, and show Intl-based alternatives.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/i18n/currency-formatting

よくある質問

価格は、なぜ国によって違って見えるのですか?

国ごとに通貨の記号、小数点、区切りが違うためです。同じ金額でも、まったく違う書き方になることがあります。

どのブラウザのツールを使いますか?

数字、通貨、日付、並べ替えのために、最新のブラウザに含まれるIntlの書式ツールを提案しています。

言語はコードで設定すべきですか?

ブラウザの既定値に頼らず、利用者のロケールを明示的に渡すことを勧めていると、このスキルは説明しています。

詳細

作者による元の説明

Use when reviewing utility functions, component props, or template strings that format numbers, prices, or dates to check whether Intl APIs are used correctly.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2805
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル