Number formatting for Value Fields

Hi Team,

I want to use custom number formating, but somehow its not working. i am using the latest release.

Below is the objective i want to achieve

Number: 12345678

Formatter String: 1,23,45,678.00


Please advise.


1 Reply

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team February 22, 2023 10:15 AM UTC

Hi Vishwa,


The formatSettings property allows you to format the pivot table values based on your needs. However, by default, our pivot table is in en-US format. To format values based on Indian culture, please load cldr-data into your application. Please also see the documentation below to learn more about globalization.


Document: https://ej2.syncfusion.com/react/documentation/pivotview/globalization-and-localization


Please refer the below code example to use the Indian culture and applied format to the values based on your needs.


Code Example:

import * as currencies from '../node_modules/cldr-data/main/hi/currencies.json';

import * as cagregorian from '../node_modules/cldr-data/main/hi/ca-gregorian.json';

import * as numbers from '../node_modules/cldr-data/main/hi/numbers.json';

import * as timeZoneNames from '../node_modules/cldr-data/main/hi/timeZoneNames.json';

import * as numberingSystems from '../node_modules/cldr-data/supplemental/numberingSystems.json';

import { loadCldr, setCulture, setCurrencyCode } from '@syncfusion/ej2-base';

 

loadCldr(currencies, cagregorian, numbers, timeZoneNames, numberingSystems);

setCulture('hi');

setCurrencyCode('INR');

 

function App() {

  const dataSourceSettings = {

    formatSettings: [{ name: 'Amount', format: 'N2' }],

 };


Output Screenshot:


Regards,

Angelin Faith Sheeba


Attachment: pivot_b483804e.zip

Loader.
Up arrow icon