We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Allow only integer numbers

Hi,

how can I setup EjsNumericTextBox so that only integer numbers are possible to enter? I've tried:

Here, when I type "10.6789", number gets displayed as "11", but when I click again on the input, value is "10.6789".
<EjsNumericTextBox TValue="int?" Value="10" ValidateDecimalOnType="true" Decimals="0" Format="n0"></EjsNumericTextBox>
<EjsNumericTextBox TValue="int?" Value="10" ValidateDecimalOnType=true Decimals="0" Format="n0"></EjsNumericTextBox>
<EjsNumericTextBox TValue="int?" Value="10" ValidateDecimalOnType=true Decimals=0 Format="n0"></EjsNumericTextBox>


Here, when I type "10.6789", number gets displayed as "10.679" and when I click on the input, value is "10.6789".
<EjsNumericTextBox TValue="int?" Value="10" ValidateDecimalOnType="true" Decimals="0" Format="n"></EjsNumericTextBox>
<EjsNumericTextBox TValue="int?" Value="10" ValidateDecimalOnType=true Decimals="0" Format="n"></EjsNumericTextBox>
<EjsNumericTextBox TValue="int?" Value="10" ValidateDecimalOnType=true Decimals=0 Format="n"></EjsNumericTextBox>



Here I tested Decimals=1 to see how it behaves. It seems that with Decimals=1, I can only type 1 decimal as expected.
<EjsNumericTextBox TValue="int?" Value="10" ValidateDecimalOnType="true" Decimals="1" Format="n0"></EjsNumericTextBox>
<EjsNumericTextBox TValue="int?" Value="10" ValidateDecimalOnType=true Decimals="1" Format="n0"></EjsNumericTextBox>
<EjsNumericTextBox TValue="int?" Value="10" ValidateDecimalOnType=true Decimals=1 Format="n0"></EjsNumericTextBox>

<EjsNumericTextBox TValue="int?" Value="10" ValidateDecimalOnType="true" Decimals="1" Format="n"></EjsNumericTextBox>
<EjsNumericTextBox TValue="int?" Value="10" ValidateDecimalOnType=true Decimals="1" Format="n"></EjsNumericTextBox>
<EjsNumericTextBox TValue="int?" Value="10" ValidateDecimalOnType=true Decimals=1 Format="n"></EjsNumericTextBox>


So it seems that Decimals=0 is problematic, as it still allows me to type decimal point and after that as many decimals as I wish.
Am I doing something wrong?

thanks


1 Reply

NP Narayanasamy Panneer Selvam Syncfusion Team October 16, 2019 12:58 PM UTC

Hi Peter,

Thanks for contacting us.
 
We have validated your query and were able to reproduce the reported issue. We have confirmed that the reported issue as bug at our end. The fix for this issue will be included in the upcoming patch release, which is expected to release on 17th October 2019. Further, you can track status through below feedback link, 
We appreciate your patience until then.

Regards,
Narayanasamy P.
 


Loader.
Live Chat Icon For mobile
Up arrow icon