da-js 1.3 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/assets/javascripts/da-js/numeric_value.js.coffee +2 -0
- data/lib/da-js/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59c2c4c4ac669f348d4b9df689d9127f6bc912b53159b1bf6f9145e77e425d62
|
4
|
+
data.tar.gz: 18536a16727126222438c61cad7332215e6427accee891ccf36e603038ba3f2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 664231e487baff6a99ba485c347949d865526ed0e47749e011328651b12a240df75dad680e223b1581f16e5ba7e0ea3bd37e3292b381b6c2a0882c030bcd519b
|
7
|
+
data.tar.gz: b3eb23fbc7436ba2c6fa9ab51461ce128e29f14ec7a2b00ed476dfd46add405c89d0b874624b4f960afb1d0573428faca8732ebb5197fdd7ea6ac97ca1773c39
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
#
|
6
6
|
# Options:
|
7
7
|
# ignoreCurrencySign: If true, values with leading currency signs (€, $) are considered numeric and parsed correctly.
|
8
|
+
# ignoreTrailingStrings: If true, values with trailing strings are considered numeric and parsed correctly.
|
8
9
|
# nullOnError: If true, null is returned (instead of 0) if the value is not numeric.
|
9
10
|
|
10
11
|
$.fn.numericValue = (options = {}) ->
|
@@ -20,6 +21,7 @@ $.fn.numericValue = (options = {}) ->
|
|
20
21
|
val = if $this.is(":input") then $this.val() else $this.text()
|
21
22
|
val = delocalize(val, locale)
|
22
23
|
val = val.replace(/^\s*[€$]\s*/, "") if options.ignoreCurrencySign
|
24
|
+
val = val.replace(/[^.\d]+$/, "") if options.ignoreTrailingStrings
|
23
25
|
if $.isNumeric(val)
|
24
26
|
parseFloat(val)
|
25
27
|
else
|
data/lib/da-js/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: da-js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Daschek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|