Skip to content
Snippets Groups Projects
Commit 5caef635 authored by Tom Robinson's avatar Tom Robinson
Browse files

Fix: Numbers in Scalar cards no longer formatted with commas

parent e755eaba
Branches
Tags
No related merge requests found
......@@ -110,6 +110,9 @@ export const isMetric = (col) => (col && col.source !== "breakout") && isSumm
export const isNumericBaseType = (field) => isa(field && field.base_type, TYPE.Number);
// ZipCode, ID, etc derive from Number but should not be formatted as numbers
export const isNumber = (field) => (field.special_type == null || field.special_type === TYPE.Number);
// operator argument constructors:
function freeformArgument(field, table) {
......
......@@ -7,6 +7,7 @@ import Ellipsified from "metabase/components/Ellipsified.jsx";
import Urls from "metabase/lib/urls";
import { formatValue } from "metabase/lib/formatting";
import { TYPE } from "metabase/lib/types";
import { isNumber } from "metabase/lib/schema_metadata";
import cx from "classnames";
import i from "icepick";
......@@ -69,7 +70,7 @@ export default class Scalar extends Component {
let compactScalarValue, fullScalarValue;
// TODO: some or all of these options should be part of formatValue
if (typeof scalarValue === "number" && (column.special_type == null || column.special_type === "number")) {
if (typeof scalarValue === "number" && isNumber(column)) {
let number = scalarValue;
// scale
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment