autonumeric-rails 1.9.19.0 → 1.9.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
/**
|
2
2
|
* autoNumeric.js
|
3
3
|
* @author: Bob Knothe
|
4
|
-
* @author: Sokolov Yura
|
5
|
-
* @version: 1.9.
|
4
|
+
* @author: Sokolov Yura
|
5
|
+
* @version: 1.9.21 - 2014-04-01 GMT 9:00 AM
|
6
6
|
*
|
7
7
|
* Created by Robert J. Knothe on 2010-10-25. Please report any bugs to https://github.com/BobKnothe/autoNumeric
|
8
8
|
* Created by Sokolov Yura on 2010-11-07
|
@@ -110,7 +110,8 @@
|
|
110
110
|
vmin = (!settings.vMin && settings.vMin !== 0) ? [] : settings.vMin.toString().split('.');
|
111
111
|
convertKeyToNumber(settings, 'vMax');
|
112
112
|
convertKeyToNumber(settings, 'vMin');
|
113
|
-
convertKeyToNumber(settings, 'mDec'); /** set mDec if not
|
113
|
+
convertKeyToNumber(settings, 'mDec'); /** set mDec if not defined by user */
|
114
|
+
settings.mDec = (settings.mRound === 'CHF') ? '2' : settings.mDec;
|
114
115
|
settings.allowLeading = true;
|
115
116
|
settings.aNeg = settings.vMin < 0 ? '-' : '';
|
116
117
|
vmax[0] = vmax[0].replace('-', '');
|
@@ -233,9 +234,8 @@
|
|
233
234
|
* function to handle numbers less than 0 that are stored in Exponential notation ex: .0000001 stored as 1e-7
|
234
235
|
*/
|
235
236
|
function checkValue(value, settings) {
|
236
|
-
|
237
|
-
checkSmall = +value;
|
238
|
-
if (decimal !== -1) {
|
237
|
+
if (value) {
|
238
|
+
var checkSmall = +value;
|
239
239
|
if (checkSmall < 0.000001 && checkSmall > -1) {
|
240
240
|
value = +value;
|
241
241
|
if (value < 0.000001 && value > 0) {
|
@@ -390,8 +390,8 @@
|
|
390
390
|
iv = iv.replace(/^0*(\d)/, '$1');
|
391
391
|
}
|
392
392
|
var dPos = iv.lastIndexOf('.'), /** virtual decimal position */
|
393
|
-
|
394
|
-
|
393
|
+
vdPos = (dPos === -1) ? iv.length - 1 : dPos, /** checks decimal places to determine if rounding is required */
|
394
|
+
cDec = (iv.length - 1) - vdPos; /** check if no rounding is required */
|
395
395
|
if (cDec <= settings.mDec) {
|
396
396
|
ivRounded = iv; /** check if we need to pad with zeros */
|
397
397
|
if (cDec < rDec) {
|
@@ -844,7 +844,7 @@
|
|
844
844
|
return this.each(function () {
|
845
845
|
var $this = $(this),
|
846
846
|
settings = $this.data('autoNumeric'), /** attempt to grab 'autoNumeric' settings, if they don't exist returns "undefined". */
|
847
|
-
|
847
|
+
tagData = $this.data(); /** attempt to grab HTML5 data, if they don't exist we'll get "undefined".*/
|
848
848
|
if (typeof settings !== 'object') { /** If we couldn't grab settings, create them from defaults and passed options. */
|
849
849
|
var defaults = {
|
850
850
|
/** allowed numeric values
|
@@ -889,7 +889,7 @@
|
|
889
889
|
* value must be enclosed in quotes and use the period for the decimal point
|
890
890
|
* value must be larger than vMin
|
891
891
|
*/
|
892
|
-
vMax: '
|
892
|
+
vMax: '9999999999999.99',
|
893
893
|
/** minimum possible value
|
894
894
|
* value must be enclosed in quotes and use the period for the decimal point
|
895
895
|
* value must be smaller than vMax
|
@@ -1,2 +1,2 @@
|
|
1
|
-
//= require autoNumeric-1.9.
|
1
|
+
//= require autoNumeric-1.9.21.js
|
2
2
|
//= require autonumeric_ujs.js
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autonumeric-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.21
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jquery-rails
|
@@ -256,7 +256,7 @@ files:
|
|
256
256
|
- spec/dummy/public/favicon.ico
|
257
257
|
- spec/spec_helper.rb
|
258
258
|
- spec/support/general.rb
|
259
|
-
- vendor/assets/javascripts/autoNumeric-1.9.
|
259
|
+
- vendor/assets/javascripts/autoNumeric-1.9.21.js
|
260
260
|
- vendor/assets/javascripts/autonumeric.js
|
261
261
|
- vendor/assets/javascripts/autonumeric_ujs.js
|
262
262
|
homepage: https://github.com/randoum/autonumeric-rails
|