1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-17 22:06:41 +02:00
TableFilter/src/helpers.js
2015-04-06 18:45:46 +10:00

34 lines
798 B
JavaScript

define(["exports", "string"], function (exports, _string) {
/**
* Misc helpers
*/
"use strict";
var Str = _string.Str;
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;
if (Str.lower(format) === "us") {
n = +n.replace(/[^\d\.-]/g, "");
} else {
n = +n.replace(/[^\d\,-]/g, "").replace(",", ".");
}
return n;
}
};
exports.Helpers = Helpers;
});
//# sourceMappingURL=helpers.js.map