UI: Add new units MBtu, MMBtu and BTU/d

This commit is contained in:
Vladyslav_Prykhodko 2025-06-20 15:17:06 +03:00
parent d2707f0042
commit 4ae0702b25
3 changed files with 75 additions and 10 deletions

View File

@ -33,7 +33,7 @@ export type EnergyMetricUnits =
| 'GJ'
| 'eV';
export type EnergyImperialUnits = 'kcal' | 'cal' | 'Cal' | 'BTU' | 'ft·lb' | 'thm';
export type EnergyImperialUnits = 'kcal' | 'cal' | 'Cal' | 'BTU' | 'MBtu' | 'MMBtu' | 'ft·lb' | 'thm';
const METRIC: TbMeasureUnits<EnergyMetricUnits> = {
ratio: 1 / 4.184,
@ -117,7 +117,17 @@ const IMPERIAL: TbMeasureUnits<EnergyImperialUnits> = {
BTU: {
name: 'unit.british-thermal-unit',
tags: ['heat', 'work done'],
to_anchor: 252.164401,
to_anchor: 252.1644007218,
},
MBtu: {
name: 'unit.thousand-british-thermal-unit',
tags: ['heat', 'work done'],
to_anchor: 252164.4007218,
},
MMBtu : {
name: 'unit.million-british-thermal-unit',
tags: ['heat', 'work done'],
to_anchor: 252164400.7218,
},
'ft·lb': {
name: 'unit.foot-pound',

View File

@ -19,7 +19,18 @@ import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type PowerUnits = PowerMetricUnits | PowerImperialUnits;
export type PowerMetricUnits = 'W' | 'μW' | 'mW' | 'kW' | 'MW' | 'GW' | 'PS';
export type PowerImperialUnits = 'BTU/s' | 'ft-lb/s' | 'hp' | 'BTU/h';
export type PowerImperialUnits =
| 'ft-lb/s'
| 'hp'
| 'BTU/s'
| 'BTU/h'
| 'BTU/d'
| 'MBtu/s'
| 'MBtu/h'
| 'MBtu/d'
| 'MMBtu/s'
| 'MMBtu/h'
| 'MMBtu/d';
const METRIC: TbMeasureUnits<PowerMetricUnits> = {
ratio: 0.737562149,
@ -65,11 +76,6 @@ const METRIC: TbMeasureUnits<PowerMetricUnits> = {
const IMPERIAL: TbMeasureUnits<PowerImperialUnits> = {
ratio: 1 / 0.737562149,
units: {
'BTU/s': {
name: 'unit.btu-per-second',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 778.16937,
},
'ft-lb/s': {
name: 'unit.foot-pound-per-second',
tags: ['mechanical power'],
@ -80,11 +86,51 @@ const IMPERIAL: TbMeasureUnits<PowerImperialUnits> = {
tags: ['performance', 'electricity'],
to_anchor: 550,
},
'BTU/s': {
name: 'unit.btu-per-second',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 778.16937,
},
'BTU/h': {
name: 'unit.btu-per-hour',
tags: ['heat transfer', 'thermal energy', 'HVAC'],
to_anchor: 0.216158,
},
'BTU/d': {
name: 'unit.btu-per-day',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 0.00900613,
},
'MBtu/s': {
name: 'unit.btu-per-second',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 778169.37,
},
'MBtu/h': {
name: 'unit.btu-per-hour',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 216.158,
},
'MBtu/d': {
name: 'unit.btu-per-day',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 9.00613,
},
'MMBtu/s': {
name: 'unit.btu-per-second',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 778169370,
},
'MMBtu/h': {
name: 'unit.btu-per-hour',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 216158,
},
'MMBtu/d': {
name: 'unit.btu-per-day',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 9006.13,
},
},
};

View File

@ -6124,6 +6124,8 @@
"electron-volts": "Electron volts",
"joules-per-coulomb": "Joules per Coulomb",
"british-thermal-unit": "British Thermal Units",
"thousand-british-thermal-unit": "Thousand British Thermal Units",
"million-british-thermal-unit": "Million British Thermal Units",
"foot-pound": "Foot-pound",
"calorie": "Calorie",
"small-calorie": "Small Calorie",
@ -6154,8 +6156,15 @@
"watt-per-square-inch": "Watts per square inch",
"kilowatt-per-square-inch": "Kilowatts per square inch",
"horsepower": "Horsepower",
"btu-per-hour": "British thermal units/hour",
"btu-per-second": "British thermal units/second",
"btu-per-hour": "British thermal units per hour",
"btu-per-second": "British thermal units per second",
"btu-per-day": "British thermal units per day",
"mbtu-per-hour": "Thousand British thermal units per hour",
"mbtu-per-second": "Thousand British thermal units per second",
"mbtu-per-day": "Thousand British thermal units per day",
"mmbtu-per-hour": "Million British thermal units per hour",
"mmbtu-per-second": "Million British thermal units per second",
"mmbtu-per-day": "Million British thermal units per day",
"foot-pound-per-second": "foot-pound per second",
"coulomb": "Coulomb",
"millicoulomb": "Millicoulombs",