mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-21 05:43:10 -07:00
Add Torr unit to pressure units in UnitConverterDataLoader.cpp
This commit adds the Torr unit to the list of pressure units in the UnitConverterDataLoader.cpp file. The Torr unit is assigned a value of 7 and its localized name and abbreviation are retrieved using GetLocalizedStringName(). Additionally, the conversion data for Torr is added to the GetConversionData() function.
This commit is contained in:
parent
5901d20532
commit
9681cfc37c
1 changed files with 4 additions and 1 deletions
|
@ -757,6 +757,8 @@ void UnitConverterDataLoader::GetUnits(_In_ unordered_map<ViewMode, vector<Order
|
||||||
pressureUnits.push_back(OrderedUnit{
|
pressureUnits.push_back(OrderedUnit{
|
||||||
UnitConverterUnits::Pressure_PSI, GetLocalizedStringName(L"UnitName_PSI"), GetLocalizedStringName(L"UnitAbbreviation_PSI"), 6, false, false, false });
|
UnitConverterUnits::Pressure_PSI, GetLocalizedStringName(L"UnitName_PSI"), GetLocalizedStringName(L"UnitAbbreviation_PSI"), 6, false, false, false });
|
||||||
unitMap.emplace(ViewMode::Pressure, pressureUnits);
|
unitMap.emplace(ViewMode::Pressure, pressureUnits);
|
||||||
|
pressureUnits.push_back(OrderedUnit{
|
||||||
|
UnitConverterUnits::Pressure_Torr, GetLocalizedStringName(L"UnitName_Torr"), GetLocalizedStringName(L"UnitAbbreviation_Torr"), 7});
|
||||||
|
|
||||||
vector<OrderedUnit> angleUnits;
|
vector<OrderedUnit> angleUnits;
|
||||||
angleUnits.push_back(OrderedUnit{ UnitConverterUnits::Angle_Degree,
|
angleUnits.push_back(OrderedUnit{ UnitConverterUnits::Angle_Degree,
|
||||||
|
@ -944,7 +946,8 @@ void UnitConverterDataLoader::GetConversionData(_In_ unordered_map<ViewMode, uno
|
||||||
{ ViewMode::Pressure, UnitConverterUnits::Pressure_KiloPascal, 0.0098692326671601 },
|
{ ViewMode::Pressure, UnitConverterUnits::Pressure_KiloPascal, 0.0098692326671601 },
|
||||||
{ ViewMode::Pressure, UnitConverterUnits::Pressure_MillimeterOfMercury, 0.0013155687145324 },
|
{ ViewMode::Pressure, UnitConverterUnits::Pressure_MillimeterOfMercury, 0.0013155687145324 },
|
||||||
{ ViewMode::Pressure, UnitConverterUnits::Pressure_Pascal, 9.869232667160128e-6 },
|
{ ViewMode::Pressure, UnitConverterUnits::Pressure_Pascal, 9.869232667160128e-6 },
|
||||||
{ ViewMode::Pressure, UnitConverterUnits::Pressure_PSI, 0.068045961016531 } };
|
{ ViewMode::Pressure, UnitConverterUnits::Pressure_PSI, 0.068045961016531 },
|
||||||
|
{ ViewMode::Pressure, UnitConverterUnits::Pressure_Torr, 0.00131578947368 } };
|
||||||
|
|
||||||
// Populate the hash map and return;
|
// Populate the hash map and return;
|
||||||
for (UnitData unitdata : unitDataList)
|
for (UnitData unitdata : unitDataList)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue