- Home
- Forum
- Angular - EJ 2
- Column setting for rounding number in 2 decimal points.
Column setting for rounding number in 2 decimal points.
Hi All,
{ field : 'gas', editType : 'numericedit ', editParams : { decimalPlaces : 2 } , format: "{0: n2}", validationRules : { required: true, min: 10, max: 10000 } , width: 80 } ,
{ field : 'gas', edit: { params : {decimals: 2, format: 'N' } } ,
I want to add a column setting for rounding number in 2 decimal points. How we can handle in a proper way? I tried to code as below,
OR
Those codes didn't work for me.
Note: I'm using Batch Edit mode, Column settings are loaded from [columns] property (Not in the html)
Thank you.
SIGN IN To post a reply.
5 Replies
HJ
Hariharan J V
Syncfusion Team
May 8, 2019 12:34 PM UTC
Hi Neo,
Greeting from Syncfusion.
We have prepared a simple to achieve your requirement("set decimal places to numeric texbox in grid batch edit") and please refer the below code snippets and sample.
[app.component.html]
<e-column field='Freight' headerText='Freight' [edit]='numEditParams' width='120' format='C3' textAlign='Right' editType='numericedit' [validationRules]='freightrules'></e-column>
[app.component.ts]
this.numEditParams = { params: {decimals: 3, format: 'n'}};
Sample: https://stackblitz.com/edit/angular-yjegvk-u8kqlc?file=app.component.ts
Regards,
Hariharan
Greeting from Syncfusion.
We have prepared a simple to achieve your requirement("set decimal places to numeric texbox in grid batch edit") and please refer the below code snippets and sample.
[app.component.html]
<e-column field='Freight' headerText='Freight' [edit]='numEditParams' width='120' format='C3' textAlign='Right' editType='numericedit' [validationRules]='freightrules'></e-column>
[app.component.ts]
this.numEditParams = { params: {decimals: 3, format: 'n'}};
Sample: https://stackblitz.com/edit/angular-yjegvk-u8kqlc?file=app.component.ts
Regards,
Hariharan
Hi Neo,
Greeting from Syncfusion.
We have prepared a simple to achieve your requirement("set decimal places to numeric texbox in grid batch edit") and please refer the below code snippets and sample.
[app.component.html]
<e-column field='Freight' headerText='Freight' [edit]='numEditParams' width='120' format='C3' textAlign='Right' editType='numericedit' [validationRules]='freightrules'></e-column>
[app.component.ts]
this.numEditParams = { params: {decimals: 3, format: 'n'}};
Sample:https://stackblitz.com/edit/angular-yjegvk-u8kqlc?file=app.component.ts
Regards,
Hariharan
Hi Hariharan,
My requirement was achieved. I have other queries to ask,
1. How to hide up & down arrows when use of 'numericedit ' type.
2. Display always 2 decimal points without thousand separates. ( Roundingwith 2 decimal points , Type: numbereditType :'stringedit ')
3.Display always 2 decimal points without thousand separates.( Roundingwith 2 decimal points, Type: stringeditType :'stringedit ', Some time data load as text. This formatting should happen if found numeric value)
Thank you.
HJ
Hariharan J V
Syncfusion Team
May 15, 2019 08:51 AM UTC
Hi Neo,
We are sorry for the delay.
Query 1:
We suggest you to use `showSpinButton` property to achieve your requirement. Please refer the below code snippets.
this.numEditParams ={ params:{decimals:3, format:'n', showSpinButton: false}};
Query 2 & 3:
We suggest you to use grid cell edit template feature to acheive your requirement. Please refer the below sample and documentation link.
Sample: https://stackblitz.com/edit/angular-yjegvk-oyq4xj?file=app.component.ts
Documentation: https://ej2.syncfusion.com/angular/documentation/grid/edit/?no-cache=1#cell-edit-template
Regards,
Hariharan
We are sorry for the delay.
Query 1:
We suggest you to use `showSpinButton` property to achieve your requirement. Please refer the below code snippets.
this.numEditParams ={ params:{decimals:3, format:'n', showSpinButton: false}};
Query 2 & 3:
We suggest you to use grid cell edit template feature to acheive your requirement. Please refer the below sample and documentation link.
Sample: https://stackblitz.com/edit/angular-yjegvk-oyq4xj?file=app.component.ts
Documentation: https://ej2.syncfusion.com/angular/documentation/grid/edit/?no-cache=1#cell-edit-template
Regards,
Hariharan
NE
Neo
July 17, 2019 08:50 AM UTC
Hi,
My requirement has been achieved. Thank you for the support.
HJ
Hariharan J V
Syncfusion Team
July 18, 2019 09:32 AM UTC
Hi Neo,
Thanks for your update.
We are happy to hear that your requirement has been achieved.
Regards,
Hariharan
Thanks for your update.
We are happy to hear that your requirement has been achieved.
Regards,
Hariharan
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
-
NE Neo
- May 3, 2019 12:24 PM UTC
- Jul 18, 2019 09:32 AM UTC