Angular Grid Numeric Inline Edit, Allow Pasted Values w/ Commas

Hello,

I have an ejs-grid column that allows inline editing:

      field="principal"
headerText="Principal"
format="C2"
textAlign="Right"
type="number"
[edit]="numericParams"
editType="numericedit"
>

My edit parameters for reference are:

numericParams = {
params: {
validateDecimalOnType: true,
showSpinButton: false,
decimals: 2,
format: 'N',
},
};

I would like to allow users to paste in numbers that contain commas and have the commas stripped out prior to filling the input.

What is the recommended approach to accommodate this?


Thanks!


1 Reply

HS Hemanthkumar S Syncfusion Team November 17, 2023 01:30 PM UTC

Hi Jefferey Mitchell,


Greetings from Syncfusion support.


The Syncfusion EJ2 NumericTextBox does not support group separators, such as commas or spaces. It is designed to accept numeric values that adhere to a specific format, including numbers, an optional sign (leading or trailing), and a single decimal point.


To utilize the NumericTextBox effectively, kindly paste the value without commas or any other non-numeric characters. For instance, you can successfully paste a value like '-11' or '3.14' but it won't accept values with spaces or commas, such as '1 000' or '1,234.56.'


Note: When you paste valid input, a thousand separators are automatically created, and the commas appear once you focus out of the component.


Regards,

Hemanth Kumar S


Loader.
Up arrow icon