mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-25 19:40:24 +00:00
chore: frontend fixes
Signed-off-by: Shivanshu Raj Shrivastava <shivanshu1333@gmail.com>
This commit is contained in:
parent
3587d7fea3
commit
1b20083f84
@ -4,14 +4,19 @@ export const getYAxisFormattedValue = (
|
||||
value: string,
|
||||
format: string,
|
||||
): string => {
|
||||
let decimalPrecision: number | undefined;
|
||||
const parsedValue = getValueFormat(format)(
|
||||
parseFloat(value),
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
);
|
||||
try {
|
||||
const parsedValue = getValueFormat(format)(
|
||||
parseFloat(value),
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
);
|
||||
|
||||
if (!parsedValue?.text) {
|
||||
return `${parseFloat(value)}`;
|
||||
}
|
||||
|
||||
let decimalPrecision: number | undefined;
|
||||
const decimalSplitted = parsedValue.text.split('.');
|
||||
if (decimalSplitted.length === 1) {
|
||||
decimalPrecision = 0;
|
||||
@ -41,9 +46,9 @@ export const getYAxisFormattedValue = (
|
||||
),
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.error('Error in getYAxisFormattedValue:', error);
|
||||
return `${parseFloat(value)}`;
|
||||
}
|
||||
return `${parseFloat(value)}`;
|
||||
};
|
||||
|
||||
export const getToolTipValue = (value: string, format?: string): string => {
|
||||
|
||||
@ -14,7 +14,7 @@ function OverallMetrics(): JSX.Element {
|
||||
title="Overall Funnel Metrics"
|
||||
subtitle={{
|
||||
label: 'Conversion rate',
|
||||
value: `${conversionRate.toFixed(2)}%`,
|
||||
value: `${(conversionRate || 0).toFixed(2)}%`,
|
||||
}}
|
||||
isLoading={isLoading}
|
||||
isError={isError}
|
||||
|
||||
@ -37,7 +37,7 @@ function StepsTransitionMetrics({
|
||||
title={currentTransition.label}
|
||||
subtitle={{
|
||||
label: 'Conversion rate',
|
||||
value: `${conversionRate.toFixed(2)}%`,
|
||||
value: `${(conversionRate || 0).toFixed(2)}%`,
|
||||
}}
|
||||
isLoading={isLoading}
|
||||
data={metricsData}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user