1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-09 01:12:38 +02:00
TableFilter/src/helpers.js

34 lines
798 B
JavaScript
Raw Normal View History

2015-04-04 10:10:09 +02:00
define(["exports", "string"], function (exports, _string) {
2015-02-28 10:27:28 +01:00
/**
* Misc helpers
*/
2015-04-06 10:45:46 +02:00
"use strict";
2015-04-04 10:10:09 +02:00
var Str = _string.Str;
2015-02-28 10:27:28 +01:00
var Helpers = {
isIE: function isIE() {
return /msie|MSIE/.test(navigator.userAgent);
},
removeNbFormat: function removeNbFormat(data, format) {
if (!data) {
return;
}
if (!format) {
format = "us";
}
var n = data;
2015-04-04 10:10:09 +02:00
if (Str.lower(format) === "us") {
n = +n.replace(/[^\d\.-]/g, "");
} else {
n = +n.replace(/[^\d\,-]/g, "").replace(",", ".");
}
return n;
2015-02-28 10:27:28 +01:00
}
};
2015-02-28 10:27:28 +01:00
exports.Helpers = Helpers;
});
//# sourceMappingURL=helpers.js.map