Results 1 to 2 of 2

Thread: format.usMoney to format.number

  1. #1

    Default format.usMoney to format.number

    Hi all,
    I'm beginner in extjs.
    I want to change format renderer usMoney into Number. For Example : 2000 into 2,000 display. I've already using usMoney and the result : $2,000. I just want to delete this '$' .

    BKKsColumnModel = new Ext.grid.ColumnModel(
    [{ header: 'No BKK', dataIndex: 'NO_BKK', width: 80, sortable: true},
    { header: 'N0 Kuitansi',dataIndex: 'NO_KUITANSI',width: 50,sortable: true},
    { header: 'Tgl', dataIndex: 'TGL',width: 100,sortable: true },
    { header: 'Uraian', dataIndex: 'URAIAN',width: 200,sortable: true},
    { header: 'Jumlah', dataIndex: 'JUMLAH',width: 90, sortable: true, summaryType: 'sum', align : 'right',
    renderer: Ext.util.Format.usMoney}
    ..........
    I've tried to change it into :
    Ext.util.Format.number()


    but always error...
    Is there something wrong...
    Thanks for any advice...

  2. #2

    Default

    I've found it. It's easy, feiuh......
    I just have to create a function :

    function change(val){
    return Ext.util.Format.number(val, '?0,000.00?');
    }
    and then point renderer into : change

    ......
    { header: 'Jumlah', dataIndex: 'JUMLAH',width: 90, sortable: true, summaryType: 'sum', align : 'right', renderer: change },
    ......
    Thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •