assets/js/components/form/field.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 10
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 3
mnd 0
bc 0
fnc 3
bpm 0
cpm 1
noi 0
1
import '../../../scss/components/form/field.scss';
2
3
$(function() {
4
    // Add a space every thousand for number inputs
5
    $('[data-type="number"]').on('input', function () {
6
        $(this).val(function (index, value) {
7
            return value.replace(/[^\dA-Z]/g, '').replace(/(.)(?=(.{3})+$)/g,'$1 ').trim();
8
        });
9
    })
10
});
11