summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Converters/MenosZeroVirgulaZeroUmConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.Converters/MenosZeroVirgulaZeroUmConverter.cs')
-rw-r--r--Decompiler/Gestor.Application.Converters/MenosZeroVirgulaZeroUmConverter.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Converters/MenosZeroVirgulaZeroUmConverter.cs b/Decompiler/Gestor.Application.Converters/MenosZeroVirgulaZeroUmConverter.cs
new file mode 100644
index 0000000..93f75e3
--- /dev/null
+++ b/Decompiler/Gestor.Application.Converters/MenosZeroVirgulaZeroUmConverter.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace Gestor.Application.Converters;
+
+public class MenosZeroVirgulaZeroUmConverter : MarkupExtension, IValueConverter
+{
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return ((decimal?)value - (decimal?)0.01m).GetValueOrDefault();
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return ((decimal?)value + (decimal?)0.01m).GetValueOrDefault();
+ }
+
+ public override object ProvideValue(IServiceProvider serviceProvider)
+ {
+ return this;
+ }
+}