Format Number Input and Output

Hi There,

I’m looking for some guidance on how to format/control how numbers are input or output within UI Builder.

I’ve noticed that if I do .5 x 4 i get a NaN error while if I do a 0.5 x 4 I get the correct answer. Is there a simple way to automatically correct the input of .5 to 0.5 or ensure that it is treated as a number?

Separately (but related) is there an easy way to return the format to be $2.00 instead of 2?

Thanks
Aaron

Hello @Aaron_Alpeter

Could you create a test page and provide us app id and page name? That will help us to reproduce your issue and offer a solution.

As for the second question, please tell me where you want to use such a format. Should it return from input? Or it’s just for a showing somewhere?

Regards, Dima.

Hi Dima,

Here is a video of the first issue. The appID is 4921FD25-45AC-9E96-FF7F-865537F72100 and I’m working inside a reusable component called “Contract Details Form” which you can find on the “FreeEstimator” page.

For the currency perspective, I’m ok if the values in backend have a standard integer format (data type is actually money), but I’d like the user to see $2, $2,000, or $2.00 depending on my use case.

Thanks
Aaron

Here is a video of the first issue.

The reason is input not triggered a change event when you type .x string into the field, and as a result, we multiply undefined with something. We couldn’t solve that for now, but aware of that issue.

As for

Separately (but related) is there an easy way to return the format to be $2.00 instead of 2?

You can check test_money_input page that I created for you. Here you could find a formatter for currency, and approach how you could let users know that the field is about currency, but not type $ into it.

Let me know if there are still somethings that need to be clarified.

Regards, Dima.

Very helpful- thank you!