diff --git a/src/Metrics/Exporter/PrometheusExporter.php b/src/Metrics/Exporter/PrometheusExporter.php index 576e605..8c63784 100644 --- a/src/Metrics/Exporter/PrometheusExporter.php +++ b/src/Metrics/Exporter/PrometheusExporter.php @@ -11,6 +11,8 @@ class PrometheusExporter extends Exporter { private int $decimals = 3; + public string $thousandsSeparator = ""; + public string $decimalSeparator = "."; public function setDecimals(int $decimals): self { @@ -45,7 +47,7 @@ public function toString(string $prefix = '', array $labels = []): string $value = $row['value']; if (is_float($value)) { - $value = number_format($value, $this->decimals); + $value = number_format($value, $this->decimals, $this->decimalSeparator, $this->thousandsSeparator); } $result[$key . '_'] = sprintf('%s %s', $key, $value);