summaryrefslogtreecommitdiff
path: root/views/js
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2020-04-27 04:07:19 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2020-04-27 04:07:19 +0000
commitef7678be4649d041a651dc226427a58b6b49c9f2 (patch)
tree8d3e0e0955d833b338f1c0d7a975135e748e0415 /views/js
parentcbfa0aeec5711e6ca684ebf7cd4094285858596c (diff)
- Feature: Umstellung PayPal Plus auf API V2
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7704 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/js')
-rw-r--r--views/js/frontend.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/views/js/frontend.js b/views/js/frontend.js
index b364265..98b9799 100644
--- a/views/js/frontend.js
+++ b/views/js/frontend.js
@@ -208,4 +208,20 @@
}
};
- \ No newline at end of file
+
+ wpsg_round = function(value, exp) {
+
+ if (typeof exp === 'undefined' || +exp === 0) return Math.round(value);
+
+ value = +value;
+ exp = +exp;
+
+ if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) return NaN;
+
+ value = value.toString().split('e');
+ value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)));
+
+ value = value.toString().split('e');
+ return +(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp));
+
+ } \ No newline at end of file