Change decimal place conditionally

Is it possible to change the inputs decimal with a condition?

Have you tried creating a conditional and seeing if there is an option from the property to change being the decimal place?

Yes I have. No there is not.

If you describe your use case, someone might have a creative suggestion, but at the very least, you could have multiple inputs with different decimal settings and show them via conditions.

For example:
ıf the result >0 use 2 decimals
else use 4 decimals.
Yes putting 2 different input fields and hiding with condition is what I’m doing but if there was a better alternative like making this on a single input would be much easier and a better solution.

Are you showing this value to the users? If yes, where are you showing it? In an input or text element. Some screenshots might help me or someone else provide a workaround

I’m showing the result to the user. It’s not text field rather input because it’s auto-binded. Users can change the value.

Ok here’s how I will do it.

Instead of having 2 inputs, you can have 1 input and one text element.

Show and hide both input and text depending on the users action, so if the user clicks the text element, hide it and show the input (set focus to the input in the same workflow) after they enter the number and click outside of the input (i.e input isn’t focused) then show the text and hide the input.

You can design the text to look like the input. Add the conditionals for the decimal places on this text element

Maybe my method is instead complicated than what you have.
Let me know if it helps.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.