• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Numeric formatting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Numeric formatting

    I have a grid with 16 numeric fields. So to make it look less crowded I am using the custom formatting option to show blanks rather then zeros. That works fine.

    The problem is I also want the amounts greater than 999 to be formatted with comma separators. The formatNumber function mentions comma's in the documentation but it appears it only formats decimal values with a period.

    Am I using the correct syntax for this function or is there another way to show the commas since I cannot use the standard formatting option with java script being present?

    formatNumber.png



  • #2
    This should do it.

    Code:
    return (v === 0) ? '' : Ext.util.Format.number(v,'0,000.00');

    Comment


    • #3
      If you do not want decimal places...

      Code:
      return (v === 0) ? '' : Ext.util.Format.number(v,'0,000');

      Comment


      • #4
        That works., Thanks!!

        Comment

        Working...
        X