0

有没有办法将某种格式放入量表的值中?这是我的代码(XAML)

    <ComponentArt:NumericGauge Height="80" 
        Name="Gauge1" 
        Width="300" 
        Grid.ColumnSpan="2" 
        Margin="0,8,0,8" 
        Grid.Row="1" 
        VerticalAlignment="Top" 
        Value="900000" 
     />

我想要这样的仪表值:$ 900.000

我的程序是用c#开发的

提前致谢

编辑:更多信息=我正在 Visual Studio 中使用 c# 开发 wpf 应用程序,我正在使用 ComponentArt 开发“Gauge”这是来自 componentart 网页的一些示例代码

http://dv2011.componentart.com/#/Views/DemoViewPage.xaml $control=Gauges&category=Numeric_Gauges&demo=Numeric_Gauge

4

2 回答 2

0

At http://www.componentart.com/community/forums/t/63716.aspx there's someone using the NumericGauge - they've provided some example code Numeric_5F00_Gauge.zip.

Inside, they are using FormatString to provide the % symbol. I guess you could try doing FormatString="$ 0.#0" or something similar? (maybe more 0's for more significant decimal places), and change your Value to 900.

于 2012-07-12T19:06:44.753 回答
0

我找到了解决方案,这是获得 90.000 美元的 FormatString

FormatString="$ #,#0"
于 2012-07-12T19:31:17.453 回答