Use de-AT locale with narrow nbsp

This commit is contained in:
2023-08-09 18:48:50 +02:00
parent 1226e85c4a
commit f4c24d9578
3 changed files with 6 additions and 3 deletions

View File

@ -35,7 +35,10 @@ namespace Elwig {
}
protected override void OnStartup(StartupEventArgs evt) {
var locale = new CultureInfo("de-DE"); // de-AT uses ' ' as thousands separator :(
var locale = new CultureInfo("de-AT");
locale.NumberFormat.CurrencyGroupSeparator = "\u202f";
locale.NumberFormat.NumberGroupSeparator = "\u202f";
locale.NumberFormat.PercentGroupSeparator = "\u202f";
Thread.CurrentThread.CurrentCulture = locale;
Thread.CurrentThread.CurrentUICulture = locale;
CultureInfo.DefaultThreadCurrentCulture = locale;

View File

@ -15,7 +15,7 @@ namespace Elwig.Dialogs {
private void ConfirmButton_Click(object sender, RoutedEventArgs evt) {
DialogResult = true;
Weight = int.Parse(WeightInput.Text.Replace(".", ""));
Weight = int.Parse(WeightInput.Text.Replace("\u202f", ""));
Reason = Regex.Replace(ReasonInput.Text, @"\s+", "").Trim();
if (Reason == "") {
Reason = null;

View File

@ -297,7 +297,7 @@ namespace Elwig.Windows {
d.Comment = (CommentInput.Text == "") ? null : CommentInput.Text;
p.SortId = (WineVarietyInput.SelectedItem as WineVar)?.SortId;
p.Weight = int.Parse(WeightInput.Text.Replace(".", ""));
p.Weight = int.Parse(WeightInput.Text.Replace("\u202f", ""));
p.Kmw = double.Parse(GradationKmwInput.Text);
p.QualId = (WineQualityLevelInput.SelectedItem as WineQualLevel)?.QualId;
p.HkId = (WineOriginInput.SelectedItem as WineOrigin)?.HkId;