How to format number of decimal places in wpf using style/template?

后端 未结 3 611
再見小時候
再見小時候 2020-11-29 01:13

I am writing a WPF program and I am trying to figure out a way to format data in a TextBox through some repeatable method like a style or template. I have a lot of TextBoxes

3条回答
  •  囚心锁ツ
    2020-11-29 01:42

    The accepted answer does not show 0 in integer place on giving input like 0.299. It shows .3 in WPF UI. So my suggestion to use following string format

提交回复
热议问题