Ag-Grid: Number Formatting eg:123456.78 to 123,457

后端 未结 3 1411
情歌与酒
情歌与酒 2021-02-13 09:40

I have huge sets of numeric data. this needs to be rendered as comma separated value. For Ex. 123456.78 to be rendered as 123,457 using Ag-Grid. Kindl

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-13 10:15

    {
             headerName: 'Salary', field: 'sal'
            cellRenderer: this.CurrencyCellRenderer
           }
    
    private CurrencyCellRenderer(params:any) {
    
        var usdFormate = new Intl.NumberFormat('en-US', {
            style: 'currency',
            currency: 'USD',
            minimumFractionDigits: 4
        });
        return usdFormate.format(params.value);
    }
    

    Like these we can mention in Angular2 Typescript code.

提交回复
热议问题