[Bug-12999]Perspective numeric entry does not obey format string

Where a format string specifies at least one required decimal place, all optional decimal places are displayed even when they are not required. If all decimal places are optional, the format is displayed correctly.

e.g. for the number 12.34

Format String >> Display
          0.# >> 12.3
         0.## >> 12.34
        0.### >> 12.34
     0.###### >> 12.34
          0.0 >> 12.3
         0.0# >> 12.34
        0.0## >> 12.340
     0.0##### >> 12.340000

You’re right - that doesn’t look like what I would expect… I’ll open an internal ticket to get this fixed.

1 Like

Hello

Ignition 8.0.13 nightly
I have a numeric entry field displaying a decimal ( 123.456789 ) with a format of 0,0.##
It display correctly as 123.46 but when you go to edit it display all decimal places. Should the format also apply when editing?

Side note, is it possible to remove the up/down arrows on the numeric entry field when editing?

It turns out that both of your questions regard expected behaviors.

The format is only applied on a visual level so as not to change any value coming in (we don’t want to change values you supply - only how they’re visually represented).

As for removing the arrows, Yousuf recommends using this: https://www.w3schools.com/howto/howto_css_hide_arrow_number.asp

Before the theming update we had removed them from Chrome but not Firefox. It sounds like going forward we’re going to be more hands-off since we’re allowing and encouraging customers to develop their own CSS. AS a result, we’ve removed the Chrome-specific removal of the arrows.

3 Likes

I am facing an issue where the customer wants to enter/display % but the backend requires a decimal value. Is there a simple solution to this using the input value component?

This caught me attention as I could not find related topics to this.

"The format is only applied on a visual level so as not to change any value coming in (we don’t want to change values you supply - only how they’re visually represented)."

I'm sure you would find many here who would argue that % is akin to units, and should be handled externally of the input. It is not common to specify units within an input, but it is common to specify the units in some sort of associated label: "pallet weight (in kg)". Percent should be used the same way: "Progress (as a percent)".
Screenshot 2024-03-18 at 8.23.42 AM
If you're using NumericEntryField.props.format, then the user doesn't supply the % piece - just the number. A value of .23 supplied by the user will be formatted and then rendered as 23%
Screenshot 2024-03-18 at 8.27.26 AM

1 Like

With a float value and a format like 0.000, the value displayed is ok but when the user edit the value, the value is displayed with all the digit and it's error prone.

IMHO it will be much more suitable to display the formatted value (0,007 in my case). Each time the user need to navigate in a tiny edit box and suppress all digit to input the new value.

An option to apply the format during input would be perfect !

image