Skip to content

Commit 974000e

Browse files
Left formatting fix for % formed from string type
1 parent 93ce27b commit 974000e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "LightPivotTable",
33
"author": "ZitRo",
4-
"version": "1.8.2",
4+
"version": "1.8.3",
55
"description": "A lightweight pivot table for MDX2JSON source for InterSystems Cache",
66
"main": "test/testServer.js",
77
"repository": {

source/js/PivotView.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,9 @@ PivotView.prototype.renderRawData = function (data) {
11111111
);
11121112

11131113
var formatContent = function (value, element, format) {
1114-
if (typeof(value) === 'string') { // not number, format as string
1115-
element.parentNode.className += " formatLeft";
1114+
if (typeof(value) === 'string') {
1115+
if (!(value[value.length - 1] === "%" && !isNaN(parseFloat(value)))) // string as %
1116+
element.parentNode.className += " formatLeft";
11161117
element.innerHTML = (value || "").replace(/(https?|ftp):\/\/[^\s]+/ig, function linkReplace (p) {
11171118
return "<a href='" + p
11181119
+ "' target='" + (_.controller.CONFIG["linksTarget"] || "_blank")

0 commit comments

Comments
 (0)