Show 2 Decimals

I have an input field set to decimal. I’d like to use this to enter a currency amount and always display the two decimal places as to not confuse the user. It seems like by default Weweb just rounds the value if it’s a whole number. Is there a way to force the field to display the .00 after a whole number? I’ve found a few things related to formulas etc., but those seems to address values coming from the database or formatting stored data. This is more of a front-end functionality I’m looking for and I have yet to find the answer.

1 Like

Did you ever find a solution to this?

Combine two elements, the “input field” and the “number” element. Then display one or the other alternatively controlled by the same bolean global variable. Transfer the input field value to the number element to see it formatted as you like. When the user clicks/touches/focus on the number element, hide it and show the input field. When the user exits the input field do the opposite.

1 Like