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 whole-degree Celsius label with the°C suffix.Type signature
ts
declare function formatCelsius(temperature: number): string;