Skip to content
Snippets Groups Projects
Commit ba2cabd1 authored by Mattias Pfeiffer's avatar Mattias Pfeiffer Committed by Tom Robinson
Browse files

Frontend: Correctly display Scalar values w/scale in compact cards

parent fbb4887a
No related branches found
No related tags found
No related merge requests found
......@@ -127,12 +127,10 @@ export default class Scalar extends Component {
// TODO: some or all of these options should be part of formatValue
if (typeof scalarValue === "number" && isNumber(column)) {
let number = scalarValue;
// scale
const scale = parseFloat(settings["scalar.scale"]);
if (!isNaN(scale)) {
number *= scale;
scalarValue *= scale;
}
const localeStringOptions = {};
......@@ -140,10 +138,12 @@ export default class Scalar extends Component {
// decimals
let decimals = parseFloat(settings["scalar.decimals"]);
if (!isNaN(decimals)) {
number = d3.round(number, decimals);
scalarValue = d3.round(scalarValue, decimals);
localeStringOptions.minimumFractionDigits = decimals;
}
let number = scalarValue;
// currency
if (settings["scalar.currency"] != null) {
localeStringOptions.style = "currency";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment