[APM] Format comparison value for all overview mobile metrics (#180353)

## Summary

Fixes https://github.com/elastic/kibana/issues/174551

### before 
![Screenshot 2024-04-09 at 12 10
11](4ebc02f0-f2ff-43e6-877b-27756272a5ab)

### after 
![Screenshot 2024-04-09 at 12 23
49](990f08da-8e7a-40db-9fdd-708c19fa2c3a)
This commit is contained in:
Katerina 2024-04-10 14:49:01 +03:00 committed by GitHub
parent d3fe5434b3
commit f469fc2940
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,7 +73,9 @@ export function MobileStats({
return (
<span>
{value && comparisonEnabled
? `${previousPeriodLabel}: ${value}`
? `${previousPeriodLabel}: ${
Number.isInteger(value) ? value : value.toFixed(2)
}`
: null}
</span>
);
@ -132,7 +134,7 @@ export function MobileStats({
: valueFormatter(Number(value.toFixed(1)), 'ms'),
trend: data?.currentPeriod?.launchTimes?.timeseries ?? [],
extra: getComparisonValueFormatter(
data?.previousPeriod.launchTimes?.value?.toFixed(1)
data?.previousPeriod.launchTimes?.value
),
trendShape: MetricTrendShape.Area,
},