2015-04-04 10:10:09 +02:00
|
|
|
define(["exports", "string"], function (exports, _string) {
|
2015-02-28 10:27:28 +01:00
|
|
|
/**
|
|
|
|
* Misc helpers
|
|
|
|
*/
|
2014-11-01 15:34:37 +01:00
|
|
|
|
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);
|
2015-03-01 11:44:39 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
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") {
|
2015-03-01 11:44:39 +01:00
|
|
|
n = +n.replace(/[^\d\.-]/g, "");
|
|
|
|
} else {
|
|
|
|
n = +n.replace(/[^\d\,-]/g, "").replace(",", ".");
|
|
|
|
}
|
|
|
|
return n;
|
2015-02-28 10:27:28 +01:00
|
|
|
}
|
|
|
|
};
|
2014-11-01 15:34:37 +01:00
|
|
|
|
2015-02-28 10:27:28 +01:00
|
|
|
exports.Helpers = Helpers;
|
|
|
|
});
|
|
|
|
//# sourceMappingURL=helpers.js.map
|