Browse Source

Decimal format value doesnt apply grouping. #588

Robin Herbots 11 years ago
parent
commit
4e07a581fd

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.0.57",
+  "version": "3.0.58",
   "main": "./dist/jquery.inputmask.bundle.js",
   "keywords" : ["jQuery", "plugins", "input", "form", "inputmask", "mask"],
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 build.major = 3
 build.minor = 0
-build.revision = 57
+build.revision = 58
 
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js

+ 8 - 7
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.0.57
+* Version: 3.0.58
 */
 
 (function ($) {
@@ -1544,6 +1544,7 @@
                         }
                         var valueBuffer = actionObj["value"].split('');
                         checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer, true);
+                        opts.onKeyPress.call(this, undefined, getBuffer(), 0, opts);
                         return isRTL ? getBuffer().reverse().join('') : getBuffer().join('');
                     case "isValid":
                         $el = $({});
@@ -1802,7 +1803,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.0.57
+* Version: 3.0.58
 */
 
 (function ($) {
@@ -2134,7 +2135,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.57
+Version: 3.0.58
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2255,7 +2256,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.57
+Version: 3.0.58
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2743,7 +2744,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.57
+Version: 3.0.58
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2987,7 +2988,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.57
+Version: 3.0.58
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
@@ -3174,7 +3175,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.57
+Version: 3.0.58
 
 Phone extension.
 When using this extension make sure you specify the correct url to get the masks

File diff suppressed because it is too large
+ 12 - 12
dist/jquery.inputmask.bundle.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/min/jquery.inputmask-multi.js


File diff suppressed because it is too large
+ 55 - 55
dist/min/jquery.inputmask.js


+ 1 - 1
jquery.inputmask.jquery.json

@@ -8,7 +8,7 @@
 		"inputmask",
 		"mask"
     ],
-    "version": "3.0.57",
+    "version": "3.0.58",
     "author": {
         "name": "Robin Herbots",
         "url": "http://github.com/RobinHerbots/jquery.inputmask"

+ 1 - 0
js/jquery.inputmask.js

@@ -1544,6 +1544,7 @@
                         }
                         var valueBuffer = actionObj["value"].split('');
                         checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer, true);
+                        opts.onKeyPress.call(this, undefined, getBuffer(), 0, opts);
                         return isRTL ? getBuffer().reverse().join('') : getBuffer().join('');
                     case "isValid":
                         $el = $({});

+ 15 - 0
qunit/tests_formatvalidate.js

@@ -14,6 +14,21 @@ test("$.inputmask.format(\"12\", {  mask: \"$ 999999\", numericInput: true, plac
     equal(formattedValue, "$ 000012", "Result " + formattedValue);
 });
 
+
+test("$.inputmask.format(\"1111111.11\" - ... autoGroup: true - swd120", function () {
+    var formattedValue = $.inputmask.format("1111111.11", {
+        alias: "decimal",
+        radixPoint: ".",
+        digits: 2,
+        autoGroup: true,
+        groupSeparator: ",",
+        groupSize: 3,
+        allowMinus: true
+    });
+    equal(formattedValue, "1,111,111.11", "Result " + formattedValue);
+});
+
+
 module("Value Validating");
 test("$.inputmask.isValid(\"23/03/1973\", { alias: \"date\"})", function () {
     var isValid = $.inputmask.isValid("23/03/1973", { alias: "date" });