WinRT 十进制到字符串格式化

WinRT decimal to string formatting

我有一个十进制值需要显示在 XAML 中。

Win RT 的问题在于它不支持 XAML 中的 StringFormat

我正在尝试使用转换器:

public class DecimalToCurrencyConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, string language)
    {
        if (value is decimal)
        {
            return value.ToString("C2", System.Globalization.CultureInfo.CurrentCulture);
        }
    }

    public object ConvertBack(object value, Type targetType, object parameter, string language)
    {
        throw new NotImplementedException();
    }
}  

问题是上述方法不起作用。

我真正需要的是像这样转换数字:

1234.781.234,781 234.781 234,78

取决于参数

如何在 WinRT 中完成?

谢谢!

试着理解这里。 WinRt/

中支持的数字格式

https://msdn.microsoft.com/en-us/library/windows/apps/windows.globalization.numberformatting.aspx