02-27-2014 01:33 AM
We have been using NationalInstruments.UI.WindowsForms.NumericEdit with FormatMode = NationalInstruments.UI.NumericFormatMode.CreateEngineeringMode("S0\'W\'", false) because we want the value to be displayed in W, mW, µw or nW depending on what is most suitable for the given value.
Now we want to do the same thing in WPF. How can we do that?
ni:NumericTextBoxDouble has a ValueFormatter propery but what should I set it to?
Regards @nders
02-27-2014 09:53 AM
Unfortunately, the WPF controls do not have built-in support for SI format values. However, you can use the custom value formatter from this answer to a similar question to use the Windows Forms format strings:
numeric.ValueFormatter = new EngineeringValueFormatter( "S0\'W\'" );