Skip to content

Commit

Permalink
format value in the footer according to locale
Browse files Browse the repository at this point in the history
  • Loading branch information
blackhexagon committed Sep 12, 2022
1 parent a060fc4 commit d4e9740
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions dev/sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"rows": {
"1": {
"values": {
"1": "50",
"2": "60",
"3": "70",
"4": "80",
"5": "90"
"1": "5000",
"2": "6000",
"3": "70.542355060",
"4": "8000351",
"5": "9000"
},
"colors": "7",
"name": "Test"
Expand Down Expand Up @@ -252,5 +252,5 @@
"orientation": "column",
"sortType": "keySort",
"sortDirection": "asc",
"locale": "cs"
"locale": "en"
}
2 changes: 1 addition & 1 deletion dist/accolade-chart-lib.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -7125,7 +7125,7 @@ function renderChartFooter(set2, { cols, colors: colorMap, unit: unit2, displayL
colorElem.style.backgroundColor = `rgb(${r}, ${g}, ${b})`;
const valueElem = document.createElement(`div`);
valueElem.className = `value`;
valueElem.innerHTML = `${format(``)(value)}${unit2 ? `${unit2 === `%` && locale2 === `en` ? `` : ` `}${unit2}` : ``}`;
valueElem.innerHTML = `${format(`,`)(value)}${unit2 ? `${unit2 === `%` && locale2 === `en` ? `` : ` `}${unit2}` : ``}`;
const labelElem = document.createElement(`div`);
labelElem.className = `label`;
labelElem.innerHTML = label;
Expand Down
2 changes: 1 addition & 1 deletion dist/accolade-chart-lib.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "https://github.com/visualio/accolade-chart-lib/issues"
},
"homepage": "https://github.com/visualio/accolade-chart-lib#readme",
"version": "1.0.11",
"version": "1.0.12",
"license": "MIT",
"main": "dist/accolade-chart-lib.umd.js",
"module": "dist/accolade-chart-lib.es.js",
Expand Down
2 changes: 1 addition & 1 deletion src/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export function renderChartFooter(set, {cols, colors: colorMap, unit, displayLeg

const valueElem = document.createElement(`div`)
valueElem.className = `value`
valueElem.innerHTML = `${format(``)(value)}${unit ? `${unit === `%` && locale === `en` ? `` : ` `}${unit}` : ``}`
valueElem.innerHTML = `${format(`,`)(value)}${unit ? `${unit === `%` && locale === `en` ? `` : ` `}${unit}` : ``}`

const labelElem = document.createElement(`div`)
labelElem.className = `label`
Expand Down

0 comments on commit d4e9740

Please sign in to comment.