index.tsx 397 B

12345678910111213
  1. import {getDuration} from 'sentry/utils/formatters';
  2. import {Vital} from 'sentry/utils/performance/vitals/types';
  3. export function formattedValue(record: Vital | undefined, value: number): string {
  4. if (record && record.type === 'duration') {
  5. return getDuration(value / 1000, 3);
  6. }
  7. if (record && record.type === 'integer') {
  8. return value.toFixed(0);
  9. }
  10. return value.toFixed(3);
  11. }