Skip to content

Adding support for Pyeong, a floorspace unit specific to Korea #382

@TurtleShip

Description

@TurtleShip

Problem Statement

Pyeong (abbreviation py) is a Korean unit of area and floorspace (wikipedia). The unit is the standard traditional measure for real estate floorspace - we use it whenever we talk about living space, office space, or even a city size.

Microsoft Calculator currently doesn't support it, and it would be great if it supports the unit.
Our target audience are Koreans, people living in Korea, and people looking at Korean real estates.

Proposal
Let's display Pyeong under Converter -> Length when a user's current locale is Korean.

Goals
User can convert Pyeong to other area units.

Non-Goals
Supporting other units specific to Korea. I would like to keep the PR for this issue simple.

Low-Fidelity Concept
Code change should be fairly simple.
An approach I have in mind is to modify UnitConverterDataLoader.cpp
Specifically, I would modify GetUnits method as below

void UnitConverterDataLoader::GetUnits(_In_ unordered_map<ViewMode, vector<OrderedUnit>>& unitMap)
{
   ...
   bool useKoreanCustomary = m_currentRegionCode == L"KP" || m_currentRegionCode == L"KR";
   ...
   areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_Pyung, GetLocalizedStringName(L"UnitName_Pyeong"), GetLocalizedStringName(L"UnitAbbreviation_Pyeong"), ...});
   ...
}

Note: Once this feature request gets approved, I would like to follow up with a PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions