[CLOSED] Override UsMoney renderer to show negative number in brackets

  1. #1

    [CLOSED] Override UsMoney renderer to show negative number in brackets

    Hey Team,

    Another common issue, which I already explored but didn't end up with any output.

    How to show the negative currency in brackets? I mean we have currency amount column in our grid and using RendererFormat.UsMoney does work all the way except for negative numbers. For us it would be great if we could override RendererFormat.UsMoney and return amount inside brackets for negative numbers.

    Or if we could somehow use FormatCurrency function of MVC.

    Thanks,
    Puneet
    Last edited by mwiater; Jul 16, 2016 at 12:45 PM.
  2. #2
    Hello Puneet!

    Have custom demands for displayed values in grid? Use a custom renderer!

    See how it's done here: Array Grid - Simple.

    There, you'll see custom renderer coloring the cell and formatting and adding a post-fixed percent (%) symbol. Instead just add the currency symbol, and format the number (probably with two-digit decimal precision) using Ext.Number.toFixed(). Then when it is < 0, remove the '-' symbol (e.g. multiplying by -1) and add the brackets.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 4
    Last Post: May 05, 2014, 2:47 PM
  2. [CLOSED] grid panel arabic number renderer
    By snow_cap in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Oct 14, 2013, 4:07 PM
  3. [OPEN] [#333] Negative number, "Comma" is disappear
    By gs_user in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 30, 2013, 5:31 AM
  4. [CLOSED] number renderer in grid column
    By Vasudhaika in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 05, 2010, 10:01 AM
  5. [CLOSED] usMoney turns negative numbers into positive
    By harafeh in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Feb 16, 2010, 7:25 PM

Posting Permissions