formatCelsius
Rounds a temperature and appends the Celsius unit. It is intended for display labels where whole-degree precision is enough.
Importing
ts
import { formatCelsius } from '@almighty-shogun/utils'Usage
ts
import { formatCelsius } from '@almighty-shogun/utils'
const label = formatCelsius(21.6);
// '22 °C'Parameters
temperature: number
Temperature value.
Returns
A formatted Celsius string.Type signature
ts
declare function formatCelsius(temperature: number): string;