Add units/prefix/suffix to numeric entry field readout

Is there a way to add units (or any other prefix/suffix) to my numeric entry field? I have bound the value property to an expression, which returns a tag value, followed by the tag’s engineering units, and it displays as such in the properties pane. But in the designer, it shows only the value, not my prefix or suffix.

I’d like to avoid having a separate label component as I don’t know of any simple way to ensure correct alignment when the units are of variable length, except for leaving enough blank space to the right, which is undesirable.

edit: I’ve also just realised that I can’t use bi-directional tag binding if I’m using an expression to append the units, so that approach wouldn’t work in any case. Hoping there’s another way?

1 Like

Numeric Entry Fields only accept/display numeric values (including scientific notation, so you could argue they accept the letter “e”), but they do not accept character inputs, nor are they able to display them. If you absolutely MUST have units attached to your values, you would need to use the Text Field Component, although at that point you lose any hand-holding in checking that a value is indeed a numeric value.

A Text Field would also allow for your bi-directional binding.

1 Like

No problem, thanks. Do you know if there’s a long-term plan to extend this sort of functionality to components like this, to bring it into line with the vision module components? Or is there a particular reason that it needs to be restricted in Perspective?

I’m finding myself feeling quite constrained by the perspective module as I’m used to the very powerful vision module, and was hoping to be able to develop my perspective application using similar philosophy. I know that this is only the first release (and still in Beta), but hopefully the functionality will continue to expand from here?

Most of it is we’re using different technology - Vision was years and years of customized Java components, whereas Perspective is less than two years of working toward getting “universally utilized” web components to perform the same functions on a different platform in a different way.

Eventually, yes, there is going to be an amazing amount of customization which will be available for all of these different components, but… that’s months and years after release.

Our long-term goal is to replace many of these universally utilized components (Dropdown, Carousel, XY Chart) with our own components so that we can allow for all of the customization users have come to expect, but it’s going to take some time.

4 Likes

Fair enough. Thanks for the background!

Looking forward to where it goes from here. Being on the bleeding edge is always fun!