← ClaudeAtlas

formatting-culture-aware-datalisted

Formats dates, numbers, and currency with culture awareness in WPF. Use when displaying localized data formats or building international applications.
christian289/dotnet-with-claudecode · ★ 40 · Data & Documents · score 76
Install: claude install-skill christian289/dotnet-with-claudecode
# Culture-Aware Data Formatting in WPF Format dates, numbers, and currency based on user's culture preferences. ## 1. Culture Formatting Overview | Data Type | en-US | ko-KR | de-DE | |-----------|-------|-------|-------| | Date (d) | 1/21/2026 | 2026-01-21 | 21.01.2026 | | Currency (C) | $1,234.56 | ₩1,235 | 1.234,56 € | | Number (N2) | 1,234.56 | 1,234.56 | 1.234,56 | | Percent (P) | 75.00% | 75.00% | 75,00 % | --- ## 2. XAML Formatting ### 2.1 Date Formatting ```xml <!-- Short date (culture-aware) --> <TextBlock Text="{Binding Date, StringFormat={}{0:d}}"/> <!-- Long date --> <TextBlock Text="{Binding Date, StringFormat={}{0:D}}"/> <!-- Custom format (not culture-aware) --> <TextBlock Text="{Binding Date, StringFormat={}{0:yyyy-MM-dd}}"/> <!-- Date and time --> <TextBlock Text="{Binding Date, StringFormat={}{0:g}}"/> ``` ### 2.2 Number Formatting ```xml <!-- Number with 2 decimal places --> <TextBlock Text="{Binding Amount, StringFormat={}{0:N2}}"/> <!-- Number with no decimals --> <TextBlock Text="{Binding Count, StringFormat={}{0:N0}}"/> <!-- Fixed decimal places --> <TextBlock Text="{Binding Value, StringFormat={}{0:F2}}"/> ``` ### 2.3 Currency Formatting ```xml <!-- Currency (culture-aware symbol and format) --> <TextBlock Text="{Binding Price, StringFormat={}{0:C}}"/> <!-- Currency with no decimals --> <TextBlock Text="{Binding Price, StringFormat={}{0:C0}}"/> ``` ### 2.4 Percent Formatting ```xml <!-- Percent (multiplies by 100) --> <TextBlock Text