//#region src/components/pisellMetricCard/utils/calculateTrend.ts
/**
* 计算趋势方向
* 
* @param comparison 环比数值
* @returns 'up' | 'down' | 'neutral'
* 
* @example
* calculateTrend(120) // 'up'
* calculateTrend(-230) // 'down'
* calculateTrend(0) // 'neutral'
* calculateTrend(null) // 'neutral'
*/
function calculateTrend(comparison) {
	if (comparison === null || comparison === void 0) return "neutral";
	const numComparison = typeof comparison === "string" ? parseFloat(comparison) : comparison;
	if (isNaN(numComparison) || numComparison === 0) return "neutral";
	return numComparison > 0 ? "up" : "down";
}
//#endregion
exports.calculateTrend = calculateTrend;
