code: def test_metrics_show_precision():
      metrics = {
          "branch_1": {
              "data": {
                  "metrics.json": {
                      "data": {
                          "a": 1.098765366365355,
                          "b": {"ad": 1.5342673, "bc": 2.987725527},
                      }
                  }
              }
          }
      }
  
      td = metrics_table(metrics, all_branches=True, precision=4)
      assert td.as_dict() == [
          {
              "Revision": "branch_1",
              "Path": "metrics.json",
              "a": "1.099",
              "b.ad": "1.534",
              "b.bc": "2.988",
          }
      ]
  
      td = metrics_table(
          metrics, all_branches=True, precision=4, round_digits=True
      )
      assert td.as_dict() == [
          {
              "Revision": "branch_1",
              "Path": "metrics.json",
              "a": "1.0988",
              "b.ad": "1.5343",
              "b.bc": "2.9877",
          }
      ]
  
      td = metrics_table(metrics, all_branches=True, precision=7)
      assert td.as_dict() == [
          {
              "Revision": "branch_1",
              "Path": "metrics.json",
              "a": "1.098765",
              "b.ad": "1.534267",
              "b.bc": "2.987726",
          }
      ]
  
imports: import textwrap
  import pytest
  from dvc.compare import diff_table, metrics_table, show_diff, show_metrics
  from dvc.utils.serialize import YAMLFileCorruptedError
label_desc: Use image node_id 22 for calling a global function with example usage: test_metrics_show_precision() without return types