# How to disable the auto-percentage calculation happen in doublebox?

526 2 2 9

If we enter 5% in a doublebox, it is automatically converted into 0.05 on onOK event.

Test code:

<window title="doublebox demo" border="normal">
<doublebox></doublebox>
<doublebox></doublebox>
</window>

But, I don't want this to happen and I want to do some calculations based on this % symbol.

Can we able to disable this auto-percentage calculation in doublebox? Or any other suggestion regarding the same?

Thanks.

delete retag edit

## 2 Replies

526 2 2 9

Thank you, jj :)

Yes, your suggestion works, but regex gets validated when the focus leaves the field.

I have set the constraint as follows:
<textbox constraint="/.[0-9|%]+/" />
Then it allows "654%43" as valid value. How can we set % as the last character and only once?

Is there any way to apply filter while typing using regex?

Thanks.

jj
638 3

[hide preview]