metabase / metabase

The simplest, fastest way to get business intelligence and analytics to everyone in your company :yum:
https://metabase.com
Other
38.71k stars 5.14k forks source link

Formatting of number of decimal places broken #28574

Open carstenkadmos opened 1 year ago

carstenkadmos commented 1 year ago

Describe the bug When trying to adjust the format of this line chart I can successfully adjust everything but the amount of decimals to show, they always seem stuck at two. The formatting is successful on the y axis but not the number call-outs. I was unable to reproduce it easily.

I know it is not connected to the custom column which is used in the question also. Thus I added the question json below

Screenshot 2023-02-23 at 14 46 05

Logs

{
description: null,
archived: false,
collection_position: null,
table_id: 146,
result_metadata: [],
creator: {
email: "",
first_name: "",
last_login: "2023-02-22T12:41:41.980539Z",
is_qbnewb: false,
is_superuser: true,
id: 20,
last_name: "",
date_joined: "2022-09-02T08:41:55.064013Z",
common_name: ""
    },
can_write: true,
database_id: 3,
enable_embedding: false,
collection_id: 42,
query_type: "query",
name: "testing formatting decimals",
last_query_start: null,
dashboard_count: 0,
average_query_time: null,
creator_id: 20,
moderation_reviews: [],
updated_at: "2023-02-23T13:54:57.637489Z",
made_public_by_id: null,
embedding_params: null,
cache_ttl: null,
dataset_query: {
type: "query",
query: {
source-table: "card__690",
filter: [
                "time-interval",
                [
                    "field",
                    2414,
                    null
                ],
                -12,
                "month",
                {
include-current: false
                }
            ],
expressions: {
% of xyz: [
                    "/",
                    [
                        "field",
                        "count",
                        {
base-type: "type/BigInteger"
                        }
                    ],
                    [
                        "field",
                        3028,
                        {
join-alias: "Dim Customers Anonymous"
                        }
                    ]
                ]
            }
        },
database: 3
    },
id: 803,
parameter_mappings: [],
display: "line",
entity_id: "aeU_id53TwcCppFQkbAtK",
collection_preview: true,
last-edit-info: {
id: 20,
email: "",
first_name: "",
last_name: "",
timestamp: "2023-02-23T13:54:57.66919Z"
    },
visualization_settings: {
graph.dimensions: [
            "dt",
            "customer_name"
        ],
graph.series_order_dimension: null,
graph.series_order: null,
graph.show_values: true,
graph.label_value_formatting: "compact",
column_settings: {
            [
                "ref",
                [
                    "expression",
                    "xyz"
                ]
            ]: {
number_style: "percent",
number_separators: ".",
decimals: 0
            }
        },
graph.metrics: [
            ""
        ]
    },
is_write: false,
collection: {
authority_level: null,
description: "For purposes of metabase feature testing",
archived: false,
slug: "testing",
color: "#509EE3",
name: "Testing",
personal_owner_id: null,
id: 42,
entity_id: "uSrIy12_ffpiqLRkfsOyw",
location: "/37/",
namespace: null,
created_at: "2022-10-20T13:11:43.713669Z"
    },
parameters: [],
dataset: false,
created_at: "2023-02-23T13:54:57.637489Z",
public_uuid: null
}

Expected behavior When entering a 1 or 3 in the "minimum number of decimal places" the format should change in the data callouts. it only adjusts the values shown on the y axis

Severity Low - it can make the visualisation look bad or force us to not use data call-outs.

Metabase Diagnostic Info

{
  "browser-info": {
    "language": "en-GB",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "ANSI_X3.4-1968",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.18+10-post-Debian-1deb10u1",
    "java.vendor": "Debian",
    "java.vendor.url": "https://tracker.debian.org/openjdk-11",
    "java.version": "11.0.18",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.18+10-post-Debian-1deb10u1",
    "os.name": "Linux",
    "os.version": "5.4.202+",
    "user.language": "en",
    "user.timezone": "Etc/UTC"
  },
  "metabase-info": {
    "databases": [
      "bigquery-cloud-sdk"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "13.7"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.5.0"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2023-02-19",
      "tag": "v0.45.3",
      "branch": "release-x.45.x",
      "hash": "070f57b"
    },
    "settings": {
      "report-timezone": null
    }
  }
}
paoliniluis commented 1 year ago

So, this is only when using custom columns and trying to customize decimal places?

carstenkadmos commented 1 year ago

I tried to replicate this for some time and find out how to trigger it. However unsuccessfully. When just using a custom column it works perfectly. If there is anything else I should provide you with, let me know