Skip to content

Commit

Permalink
[#259] Fix load value in income data driver page
Browse files Browse the repository at this point in the history
  • Loading branch information
wayangalihpratama committed Jan 25, 2024
1 parent aa8f111 commit eb73f0a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontend/src/pages/cases/components/DataFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import Chart from "../../../components/chart";
import { SaveAsImageButton, ShowLabelButton } from "../../../components/utils";
import { api } from "../../../lib";
import { driverOptions } from "../../explore-studies";
import { thousandFormatter } from "../../../components/chart/options/common";

const LIBTooltipText = (
<div>
Expand Down Expand Up @@ -635,7 +636,12 @@ const DataFields = ({
key: "value",
title: "Value",
dataIndex: "value",
render: (value) => value || "-",
render: (value) => {
if (value && Number(value)) {
return thousandFormatter(value);
}
return value || "-";
},
},
{
key: "unit",
Expand Down Expand Up @@ -714,6 +720,9 @@ const DataFields = ({
?.map((x) => upperFirst(x))
?.join(" ");
let value = record[key];
if (value && Number(value)) {
value = thousandFormatter(value);
}
if (value && !Number(value)) {
value = value
.split(" ")
Expand Down

0 comments on commit eb73f0a

Please # to comment.