Skip to content

[PTRun Unit Converter] Support for 'sq' prefixed units#37648

Closed
OldUser101 wants to merge 3 commits intomicrosoft:mainfrom
OldUser101:_PTRunUnitConverter37553
Closed

[PTRun Unit Converter] Support for 'sq' prefixed units#37648
OldUser101 wants to merge 3 commits intomicrosoft:mainfrom
OldUser101:_PTRunUnitConverter37553

Conversation

@OldUser101
Copy link
Contributor

Summary of the Pull Request

Adds support for square units prefixed with sq. For example, sqm for square metres, instead of m^2.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Used simple substitution to swap sq prefixed units with their ^2 equivalent. For example, sqft is substituted with ft², which is supported by UnitsNet.

For example, converting square feet to square metres can be done as follows:

image

Rather than:

image

This is additional to ^2 suffixed units, which are still available.

Validation Steps Performed

Basic testing done for each unit.

@github-actions

This comment has been minimized.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for square units prefixed with "sq" by converting them into their equivalent "²" notation, enabling users to use units like "sqm" instead of "m^2".

  • Introduces SquareHandler to handle conversion of "sq" prefixed units.
  • Integrates the new handler in the Parse method for unit conversion queries.
Files not reviewed (1)
  • .github/actions/spell-check/expect.txt: Language not supported

@yeelam-gordon yeelam-gordon requested a review from moooyo March 31, 2025 05:29
@yeelam-gordon
Copy link
Contributor

Let's migrate to v2.

@moooyo
Copy link
Contributor

moooyo commented Mar 31, 2025

Close this PR due to another better impl has been merged.
#37862

@moooyo moooyo closed this Mar 31, 2025
@moooyo
Copy link
Contributor

moooyo commented Mar 31, 2025

I'm pleasure to help if anyone want to migrate it to v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants