What is the best way to control numeric format for TestStep results? Say I want the value to be shown with two fractional digits (0.62) and perhaps also with a unit (0.62dB). Should I add a FormattedResult property in addition to the Result property?
@GoranJohnsson have you looked at the Unit attribute? I believe that solves most of your problems. It will easily allow for units and engineering prefixes, but there is also a StringFormat setting that will allow you to define units of precision, hex, binary, etc.
The Units attribute example is here:
We leverage the standard .NET String Format syntax:
Hi @GoranJohnsson, just curious, how did you get that result in the Step Settings panel, with what appears to be a radio button? Is that a custom IControlProvider, or does TAP have some built-in functionality I’m not aware of?
@david-wsd Are you referring to the value format or the “radiobutton”?
The value format comes from the settings attribute:
[Output]
[Unit(“dB”,UseEngineeringPrefix:true,StringFormat:“F2”)]
public double Result { get; private set; }
The “radiobutton” is just the standard output icon
@GoranJohnsson Yes, the radio button. You answered my question, thanks! The Output attribute is what I was looking for.