• 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.

Formatting of Dollar Fields

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

  • Formatting of Dollar Fields

    I have a couple requests received multiple times from my users for formatting options of money fields....

    On input capable fields on Forms, they want to see their entries properly formatted as $5.00... Currently it renders as 5.

    In Grids, they'd like a format option which will render '---' when the field is 0. Currently this renders as $0.00. If this is possible, I'd also like to see an empty cell in this scenario. I tried a couple scripting approaches but they were clunky at best. I can do what they want in the datasource as well, but that seems like a lot of code.....

    Let me know if doable... Thanx





  • #2
    The input capable fields are not currently possible (as you probably already know). We can add this to the feature request list.

    Your grid render request is possible if using a custom formatter/renderer:

    Code:
    if (v !== 0){
      return Ext.util.Format.usMoney(v);
    } else {
       return '---';
    }

    Comment


    • #3
      OK on form.... i tried a couple different formatters.... they looked cheesy.... but i'll try this one....

      Thanx

      Comment

      Working...
      X