LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to prohibite input in SI notation in numeric control?

Input can be 3000, 3e+3, or 3k (SI).

How to prohibite input in SI notation, for example "3k"?

 

Thanks, Andrey.

0 Kudos
Message 1 of 4
(2,517 Views)

I'm not sure I entirely understand the question. Are you saying you don't want a user to be able to enter "3K" into a numeric control instead of "3000"? Curious: why?

0 Kudos
Message 2 of 4
(2,516 Views)

@smercurio_fc wrote:

I'm not sure I entirely understand the question. Are you saying you don't want a user to be able to enter "3K" into a numeric control instead of "3000"? Curious: why?


actually, this is customer's question.

he wants to avoid situation when user make mistake like getting "3000" (="3k") instead of "30"

0 Kudos
Message 3 of 4
(2,507 Views)

My first choice would be to simply use the Data Range to prevent out of range values regardless of how they are input.  If you really want to filter the allowed keys you need to use an Event Structure.  Here is an example, the string contains the allowed ascii characters, a separate case also allows Enter, Return and Delete, all other keys are blocked.   In the Disabled Case of the Diagram Disable Structure is simply a constant lookup table since you really only need to calculate it once unless something changes.

 

FilterIntegerKeys.png

 

Of course a fiendishly clever person could always paste an SI value in there.  (Why I would also rely on Data Range)

Message 4 of 4
(2,499 Views)