Support degree symbols for temperature units (#6498)

This commit is contained in:
Oliver 2024-02-16 11:00:17 +11:00 committed by GitHub
parent 21f209f7cc
commit 43457d4136
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,6 +45,11 @@ def reload_unit_registry():
reg.define('hundred = 100') reg.define('hundred = 100')
reg.define('thousand = 1000') reg.define('thousand = 1000')
# Temperature units
reg.define('degreeC = °C = degC = celsius = Celsius')
reg.define('degreeF = °F = degF = fahrenheit = Fahrenheit')
reg.define('degreeK = °K = degK = kelvin = Kelvin')
# Allow for custom units to be defined in the database # Allow for custom units to be defined in the database
try: try:
from common.models import CustomUnit from common.models import CustomUnit