microsoft / calculator

Windows Calculator: A simple yet powerful calculator that ships with Windows
MIT License
29.5k stars 5.35k forks source link

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

Closed TurtleShip closed 5 years ago

TurtleShip commented 5 years ago

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.

rudyhuyn commented 5 years ago

Great idea! (and I don't say that because we work together 😉)

It can be a good addition to Converter -> Area but IMO we shouldn't limit it to the Korean locale, a Korean with a PC set in English or a foreigner reading a Korean documentation would also find it useful.

Is this unit widely used in Korean? Would it make sense to set this unit as the default conversion target when the locale is Korean? (So it will display by default Square meters to Pyeong).

MicrosoftIssueBot commented 5 years ago

This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it.

TurtleShip commented 5 years ago

@rudyhuyn Haha, thanks! ( also feels funny to talk over here while we are sitting next to each other :D )

To answer your question, yes, it makes sense to set Pyeong as the default conversion target when the locale is Korean. ( Perhaps Pyeong to Square meters instead of Square meters to Pyeong because most of the time, I think Koreans would try to convert Pyeong to Square meters ). Also, I am good with your suggestion of not limiting Pyeong to the Korean locale and instead displaying it in all locales.

Also, yes, the unit is dominant in Korea. There were some efforts in the past from the Korean government to get Koreans to replace Pyeong with square meters, but it failed quite spectacularly. From daily conversations to official postings related to real estate, Pyeong is the unit all Koreans use.

Sidetracking a bit, my aunt is in real estate business, and she sometimes find hard to convert Pyeong for foreigners ( there are increasing number of foreigners visiting / staying in Korea ). I am guessing foreigners in Korea are fairly confused on how to convert Pyeong as well.

Hopefully, Microsoft calculator helps these scenarios.

grochocki commented 5 years ago

Thanks for the feature suggestion! This is really well thought-out, and I appreciate that. I also learned something new today (the Pyeong)!

To answer your question, yes, it makes sense to set Pyeong as the default conversion target when the locale is Korean.

If this is the case, I would be open to making this the default in Korean locales. Outside of your own experiences, is there any data to suggest this is still widely used as the default to support this change?

Also, I am good with your suggestion of not limiting Pyeong to the Korean locale and instead displaying it in all locales.

I disagree with @rudyhuyn in this case and think your original proposal to limit this to Korean locales makes the most sense (at least for now). While it could certainly serve as a learning opportunity for those not familiar with the unit, it would also add unnecessary complexity by surfacing a non-standard/customary unit that is not likley to be used outside of Korea. If we were to broaden the scope to other customary units (1, 2, 3, etc.), I think I would still advocate for most of these being "off" by default, with the option to enable them as a setting.

In South Korea, the unit has been officially banned since 1961 but with little effect prior to the criminalization of its commercial use effective 1 July 2007. Informal use continues, however, including in the form of real estate use of unusual fractions of meters equivalent to unit amounts of pyeong. (Wikipedia)

If this is the case, we may not be able to support this conversion, even if it is still used informally.

Let's keep this idea open for discussion so the community has the chance to provide feedback. Check out our New Feedback Process for more info on the user-centered process we follow for new feature development.

TurtleShip commented 5 years ago

Thanks for your prompt reply, @grochocki !

To address your question regarding data backing prevalent use of Pyeong, we could start with this Wikipedia article which has a healthy amount of citations within the first couple sentences of section Area. Relevant part would be

Despite being notionally illegal, the pyeong remains particularly common when discussing residential and commercial floorspace[34][35][18] and tiles

Even after 10 years since the Korean government tried, it hasn't had much effect. I am assuming similar situation may happen if the US government one day told everyone to stop using feet and use centimeter instead :)

So I looked up the official act specifying it ( Korean | English ). The relevant part is Measures Act - Chapter 1 - Article 6.

The gist of it is that you are not allowed to use non-standard measurement ( which Pyeong would be one, but the law doesn't specifically call it out ) on any advertisement. In case you violate it, you may need to pay fine ( or just simply take down the advertisement ).

In our case, I believe we are good to add the conversion because Microsoft Calculator is not

For example, on naver.com, which is a Korean version of Google, provides conversion from 평(pyeong) to other measuring units.

So to sum up, Microsoft Calculator wouldn't fall under Measures Act in Korea. Also, I think criminalization is a bit of strong word from Wikipedia, but that's a separate issue and I will see if I can edit it.

Thanks again for your prompt and thoughtful reply!

rudyhuyn commented 5 years ago

I think I would still advocate for most of these being "off" by default, with the option to enable them as a setting.

I like this idea of having a shorter list of units by default (based on locations) but providing a way to add/remove units in settings or an option 'more units...' at the bottom of the combobox would be nice. It would solve the issue of Korean expats or tourists wanting to convert a unit they don't know.

This settings would also improve the UX. The data converter is a good example. It currently contains 37 units (!!), a more curated list of units would probably make the converter easier to use for users unfamiliar with a lot of these units with similar names, but if a pro-user wants to convert Exbibytes into Yobibits, they would still be able to do it.

grochocki commented 5 years ago

@TurtleShip Sorry for the delay, but I wanted to double-check on this on our side

So to sum up, Microsoft Calculator wouldn't fall under Measures Act in Korea.

We reviewed the pitch and would love to move forward with it. Let's scope this to adding the Pyeong for Korean locales for now. Since the idea is fairly straightforward and is entirely captured by the pitch, we can move this straight into production. @TurtleShip, if you are still interested in implementing this one, it is yours!

@rudyhuyn @TurtleShip Feel free to submit a new idea to cover broader support for customary units and/or more configurable unit settings (you both don't use yobibits daily like us here in Redmond? 😋)

TurtleShip commented 5 years ago

Hi, @grochocki

Thanks for getting back! Yes, I am still interested in implementing this one 😄 I can work on it this weekend and hopefully submit a PR as well!