How to format number input value

I'm working on pre-populating a form with values from a database, and one of the inputs is "Sales Price." In the database, this value is stored as 1990, which represents $19.90. However, when displayed in my number input, it appears as 1990.00.

I tried dividing the value by 100 in the input settings and changing the type of "Format" it is from currency, to percent, to standard , but I'm unable to apply this transformation to the default value. I'm having trouble figuring out how to properly format the value to display as 19.90. Is there a way to achieve this?

You're almost there! You just need to add toFixed to format the value to n decimal places.

A super quick inline transform:

{{ (item.value / 100).toFixed(2) }}

should get you from 1990 to 19.90.

1 Like

Hi @ovryu,

You can do this by placing the decimal points as shown in the screenshot below.

Feel free to ask if you need further assistance or have additional questions. We're here to help!

4 Likes