Skip to content

Commit

Permalink
Left formatting fix for % formed from string type
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Jul 1, 2017
1 parent 93ce27b commit 974000e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "LightPivotTable",
"author": "ZitRo",
"version": "1.8.2",
"version": "1.8.3",
"description": "A lightweight pivot table for MDX2JSON source for InterSystems Cache",
"main": "test/testServer.js",
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions source/js/PivotView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1111,8 +1111,9 @@ PivotView.prototype.renderRawData = function (data) {
);

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

0 comments on commit 974000e

Please sign in to comment.