X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/source/Format.html diff --git a/docs/source/Format.html b/docs/source/Format.html index 8aef8075..04f7462d 100644 --- a/docs/source/Format.html +++ b/docs/source/Format.html @@ -30,7 +30,7 @@ Options include: - currenyPrecision - currencySign - currencyAtEnd -This class also uses the default date format defined here: {@link Ext.date#defaultFormat}. +This class also uses the default date format defined here: {@link Ext.Date#defaultFormat}. __Using with renderers__ There are two helper functions that return a new function that can be used in conjunction with @@ -332,8 +332,7 @@ XTemplates can also directly use Ext.util.Format functions: * @param {String} format The way you would like to format this text. * @return {String} The formatted number. */ - number: - function(v, formatString) { + number: function(v, formatString) { if (!formatString) { return v; } @@ -412,6 +411,15 @@ XTemplates can also directly use Ext.util.Format functions: fnum = psplit[0] + dec + psplit[1]; } } + + if (neg) { + /* + * Edge case. If we have a very small negative number it will get rounded to 0, + * however the initial check at the top will still report as negative. Replace + * everything but 1-9 and check if the string is empty to determine a 0 value. + */ + neg = fnum.replace(/[^1-9]/g, '') !== ''; + } return (neg ? '-' : '') + formatString.replace(/[\d,?\.?]+/, fnum); }, @@ -469,7 +477,7 @@ XTemplates can also directly use Ext.util.Format functions: /** * Convert certain characters (&, <, >, and ') from their HTML character equivalents. - * See {@link Ext.string#htmlDecode}. + * See {@link Ext.String#htmlDecode}. * @method */ htmlDecode: Ext.String.htmlDecode,