mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Preventing temperature going below absolute zero.
This commit is contained in:
parent
1a41cd6aac
commit
9dd027b86b
1 changed files with 6 additions and 0 deletions
|
|
@ -35,6 +35,12 @@ export function TemperatureCalculator() {
|
|||
newCelsius = roundDigits(numValue - 273.15);
|
||||
newFahrenheit = roundDigits((newCelsius * 1.8) + 32);
|
||||
}
|
||||
if (newFahrenheit < -459.67) {
|
||||
console.warn('Temperature was below absolute zero!');
|
||||
newCelsius = -273.3;
|
||||
newFahrenheit = -459.67;
|
||||
newKelvin = 0;
|
||||
}
|
||||
setState({
|
||||
celsius: newCelsius,
|
||||
fahrenheit: newFahrenheit,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue