Compare commits
No commits in common. "12e66397d84bd55cde0c1b209d3e943e5e20bcb9" and "99d25ecd309a1a496b687d8632e6e8b88e271ff4" have entirely different histories.
12e66397d8
...
99d25ecd30
|
|
@ -4,12 +4,3 @@ import { twMerge } from "tailwind-merge"
|
|||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
|
||||
export const formatTemperature = (
|
||||
temp: number,
|
||||
unit: 'celsius' | 'fahrenheit' = 'celsius'
|
||||
): string => {
|
||||
const value = unit === 'fahrenheit' ? (temp * 9) / 5 + 32 : temp;
|
||||
const symbol = unit === 'fahrenheit' ? '°F' : '°C';
|
||||
return `${Math.round(value)}${symbol}`;
|
||||
};
|
||||
Loading…
Reference in New Issue