mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-27 21:27:19 -08:00
20 lines
769 B
C#
20 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") + "%");
|
|||
|
}
|
|||
|
}
|