Results 1 to 2 of 2

Thread: Ext.util.Format.currency decimals ignored when set to 0

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-4444 in a recent build.
  1. #1
    Sencha User grgur's Avatar
    Join Date
    Aug 2007
    Location
    Split, Croatia
    Posts
    155
    Vote Rating
    26
      0  

    Default Ext.util.Format.currency decimals ignored when set to 0

    Ext.getVersion() => 4.0.7

    I'll try to get straight to the point. If you do:
    Code:
    Ext.util.Format.currency(100, '$', 0);
    ... the output is same as
    Code:
    Ext.util.Format.currency(100, '$', Ext.util.Format.currencyPrecision);
    ... and it reads "$100.00" instead of "$100", which is caused by this line in Ext.util.Format, currency function definition:
    Code:
     decimals = decimals || Ext.util.Format.currencyPrecision;
    Obviously, decimals should be tested with a stricter comparison operator, such as

    Code:
     decimals = Ext.isNumber(decimals) ? decimals : Ext.util.Format.currencyPrecision;

    Cheers
    <div style="float: left; width: 70px;">http://appac.us/mcs.png</div><div style="float: left; height: 100px;">Grgur Grisogono
    Ext JS in Action SE co-author
    Exercising awesomeness at Modus Create - Official Sencha Partner

    Get in touch for Sencha Touch Training
    @ggrgur</div><div style="clear:both;"></div>

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Oh grgur.... reporting bugs is fun huh? Looks like it was fixed already tho!
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

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