Decimal input problem

Hello,

I have an issue with numerical input field when the user inputs a decimal amount. This works fine if the amount is inputted with a 0 in front of the decimal point (ex 0.25) but doesn’t work when the user does not input the 0 before the decimal point (ex .25).

Is this the intended functionality? Is there a suggestion for some logic that could capture this input and convert to a decimal number?

Hi Luc,

I played with it and could not find a workaround. I think it would be somewhere in the internals of the Input component to enable the behavior you’re talking about. @vladimir-upirov do you think we could change that?

Mark

1 Like

@vladimir-upirov is this possible to change?

Hello @Luc_Zentar

Sorry for the late response!

This is not a typical case, let me explain how it works at this moment:

the input contains internal validators for Number type, which means a user is able to not valid number string, but the OnChangeHandler is fired only when there is a valid number string

So, right now I can see no ways to determine when a user typed for instance “.25” and convert it to “0.25”

However, I assume we can add a new event handler “OnKeyUp”, it gives us an option to use logic to determine a current value in the input and then if it starts on “.” add a zero in front of the current value

Does it make sense?

@vladimir-upirov no problem, thank you for the reply.

That sounds like exactly what is needed.

Alright, I’ve created an internal ticket BKNDLSS-28504, once it’s done we notify you here in the topic

1 Like

@Luc_Zentar I just released the fix, could you please try it out and give us your feedback

I used the following logic and it works for me:

It works, thank you @vladimir-upirov for the fast fix