# Best way to implement a generic Check Numeric Limits test step

**URL:** <https://forum.opentap.io/t/best-way-to-implement-a-generic-check-numeric-limits-test-step/738>\
**Category:** Technical\
**Tags:** plugin\
**Created:** [June 21, 2022, 4:08pm UTC](https://forum.opentap.io/t/best-way-to-implement-a-generic-check-numeric-limits-test-step/738 "2022-06-21T16:08:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tatiana.boye](https://avatars.discourse-cdn.com/v4/letter/t/ba8739/32.png) [@tatiana.boye](https://forum.opentap.io/u/tatiana.boye)\
**Post date:** [June 21, 2022, 4:08pm UTC](https://forum.opentap.io/t/best-way-to-implement-a-generic-check-numeric-limits-test-step/738/1 "2022-06-21T16:08:39Z")

</div>

We’re currently trying to implement a set of helper test steps that would allow for verification of measurements etc. in order to produce test verdict. While it’s pretty straightforward with strings and booleans, it’s not that obvious how to make a step that would be able to check value of _any_ numeric datatype against limits. Sticking to `Double` as the only numeric datatype doesn’t seem right, neither does creating a step per datatype.

I assume such functionality might be interesting to other users, so I’d like to see if anyone has suggestions/experience of implementing it in a generic way.

Generally we prefer to assign inputs of such steps directly to outputs of steps that are responsible for outputting data but if we’d need to choose an input from the list that would also do.

Thanks!

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [June 23, 2022, 12:41pm UTC](https://forum.opentap.io/t/best-way-to-implement-a-generic-check-numeric-limits-test-step/738/2 "2022-06-23T12:41:18Z")

</div>

Currently the type of input and output has to match exactly, so there is not really any obvious way to do it at the moment.

Maybe we could add a conversion so that the input could just be and ‘object’ and the check numeric limits could then just reinterpret it as a double or integer, or whatever.

My suggestion would be to stick with ‘double’ for now.

---

<div class="post-metadata">

**Author:** ![tatiana.boye](https://avatars.discourse-cdn.com/v4/letter/t/ba8739/32.png) [@tatiana.boye](https://forum.opentap.io/u/tatiana.boye)\
**Post date:** [June 23, 2022, 12:56pm UTC](https://forum.opentap.io/t/best-way-to-implement-a-generic-check-numeric-limits-test-step/738/3 "2022-06-23T12:56:38Z")

</div>

> Maybe we could add a conversion so that the input could just be and ‘object’ and the check numeric limits could then just reinterpret it as a double or integer, or whatever.

That would be great!

For now we decided to go for a workaround. Our step will have a selector of datatype + a set of parameters with fixed datatypes while only the parameter of currently selected type will be shown. We find this solution a bit better than changing datatype to `Double` in many steps we have.
