Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Display/Hide Decimal

Avatar

Former Community Member

Good Morning,

This seems very simple, but I can't figure it out:

I have a numeric field that I need a user to enter a number. This number can be either whole or a decimal with 2 trailing values after the decimal point. For example:

1

1.15

1.30   etc.

I need the field to display the whole number if there is no decimal value, but if there is a decimal value then I need the field to always display 2 numbers after the decimal. I have gotten the field to show the first two examples above, but in the 3rd example (1.30), the field wants to drop the "0". I need to keep the two places displayed (1.30).

any ideas?

thanks!!!!

Gene-O

1 Reply

Avatar

Level 10

Are you using any Display Patterns?

Try something like: num{zzzz9.99}