queryCellInfo to limit decimals

Hi, im using React typescript and im trying to limit the decimals, every option i tried doesn't work at all, i tried everything and nothing, 


<ColumnsDirective>
{visibleColumns.length ? (
visibleColumns.map((headCol) => {
if (!headCol.hidden) {
return headCol.columnSpecs.length && headCol?.columnSpecs?.filter((col) => !col.hidden)?.length ? (
<ColumnDirective
key={headCol.columnSpecs[0].fieldId}
allowResizing={false}
columns={
headCol.columnSpecs.map((col) => {
return {
field: col.fieldId,
headerText: col.label,
groupId: headCol.columnGroupId,
width: col.width || 120,
minWidth: 50,
maxWidth: 250,
type: col.valueFormat,
format: col.valueFormat === 'date' ? 'dd/MM/yyyy' : undefined,
edit: col.editable,
textAlign: capitalize(col.horizontalAlign || ''),
};
}) as unknown as ColumnModel[]
}
headerTextAlign="Center"
headerText={headCol.label}
/>

this is part of my component, i use queryCellInfo but nothing happen here, any suggestions??? also i tried with localization and still the s


1 Reply 1 reply marked as answer

PS Pavithra Subramaniyam Syncfusion Team August 23, 2022 02:22 PM UTC

Hi Fernando Haring,


Thanks for contacting Syncfusion support.


You can limit the decimal points for the number column by setting the column “format” property itself. Please refer to the below code example and documentation link for more information.


 

format: col.valueFormat === 'date' ? 'dd/MM/yyyy' : col.valueFormat === 'number' ? N2: undefined // "N2" will show the 2 decimal places

 


Documentation: https://ej2.syncfusion.com/react/documentation/common/internationalization/#number-formatter-and-parser

                            
https://ej2.syncfusion.com/react/documentation/common/internationalization/#custom-number-formatting-and-parsing


Please get back to us if you need further assistance on this.


Regards,

Pavithra S


If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Marked as answer
Loader.
Up arrow icon