mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-26 21:17:20 -08:00
19 lines
769 B
C#
19 lines
769 B
C#
using Avalonia.Data.Converters;
|
|
|
|
namespace SourceGit.Converters
|
|
{
|
|
public static class DoubleConverters
|
|
{
|
|
public static readonly FuncValueConverter<double, double> Increase =
|
|
new FuncValueConverter<double, double>(v => v + 1.0);
|
|
|
|
public static readonly FuncValueConverter<double, double> Decrease =
|
|
new FuncValueConverter<double, double>(v => v - 1.0);
|
|
|
|
public static readonly FuncValueConverter<double, string> ToPercentage =
|
|
new FuncValueConverter<double, string>(v => (v * 100).ToString("F3") + "%");
|
|
|
|
public static readonly FuncValueConverter<double, string> OneMinusToPercentage =
|
|
new FuncValueConverter<double, string>(v => ((1.0 - v) * 100).ToString("F3") + "%");
|
|
}
|
|
}
|