Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/303.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WPF-提升到-转换器的功率_C#_Wpf - Fatal编程技术网

C# WPF-提升到-转换器的功率

C# WPF-提升到-转换器的功率,c#,wpf,C#,Wpf,有谁能给我提供一些指针或指引我到WPF的示例转换器,该转换器将取100这样的数字并将其转换为10²吗?示例WPF转换器: public class NumberConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { //do you

有谁能给我提供一些指针或指引我到WPF的示例转换器,该转换器将取100这样的数字并将其转换为10²吗?

示例WPF转换器:

public class NumberConverter : IValueConverter
{

    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        //do you conversion here - "value" is the parameter you need to convert and return
    }

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        //you can optionally implement the conversion back (from scientific value to integer)
        throw new NotImplementedException();
    }
}
我不确定您到底想如何转换数字,但您可以在这里找到一些示例:

您希望您的数字用数字表示吗?比如说,你将如何代表9529?非常容易使用(特别是当您只需要单向使用时)。如果有什么东西让你卡住了,为什么不试试并问一个具体的问题。我想你在找
log10(100)
,即
System.Math.Log(100,10)