Skip to content

Commit

Permalink
Add Culture sample
Browse files Browse the repository at this point in the history
  • Loading branch information
giard-alexandre committed May 9, 2024
1 parent 4548cb6 commit 47a7c17
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
using Avalonia.Controls;
using Avalonia.Controls.Models.TreeDataGrid;
Expand Down Expand Up @@ -32,7 +33,9 @@ public CountriesPageViewModel()
new TextColumn<Country, int>("GDP", x => x.GDP, new GridLength(3, GridUnitType.Star), new()
{
TextAlignment = Avalonia.Media.TextAlignment.Right,
MaxWidth = new GridLength(150)
MaxWidth = new GridLength(150),
StringFormat = "{0:C}", // Format as Currency
FormatCultureInfo = CultureInfo.GetCultureInfo("en-US"), // Format this as USD
}),
}
};
Expand Down

0 comments on commit 47a7c17

Please sign in to comment.