mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-10-30 14:49:14 +00:00
14 lines
402 B
TypeScript
14 lines
402 B
TypeScript
import {getDuration} from 'sentry/utils/formatters';
|
|
import type {Vital} from 'sentry/utils/performance/vitals/types';
|
|
|
|
export function formattedValue(record: Vital | undefined, value: number): string {
|
|
if (record && record.type === 'duration') {
|
|
return getDuration(value / 1000, 3);
|
|
}
|
|
if (record && record.type === 'integer') {
|
|
return value.toFixed(0);
|
|
}
|
|
|
|
return value.toFixed(3);
|
|
}
|