开发者

Custom Format String that doesn't show trailing "." when the number is whole

We're currently using a custom format string: "#,###.##"

In our DevExpress control in the following way:

"Settings:TextEditSettings MaskType="Numeric" DisplayFormat="#,###.00;;#" Mask="#,###.##"/"

Imagine the input to this is the double "20.000".

We'd like this to be "20.00" in display mode, and "20" in edit mode (i.e. what the Mask is trying to specify). We find that this almost works, but there we get "20." in edit mode. Can anyone advise on a format string that does not have the trailing "." when the number is 开发者_开发技巧whole?

Thanks.


For display mode use "0#.0#" and in Edit mode use "0#"

[Edit]: Since your showing commas for display, use "0#,###.0#"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜