-
-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICU-21349 Add UnitsConverter.getConversionInfo() #1568
Conversation
e7a2d50
to
2648fe2
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
6cd0d6d
to
59f7b24
Compare
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
59f7b24
to
44f6d19
Compare
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
44f6d19
to
8446cda
Compare
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Review at 8446cda)
Looks good - just a couple of comments, with suggestions: if you like the suggestions, you can apply them and squash immediately.
@@ -82,6 +82,12 @@ struct U_I18N_API Factor { | |||
void substituteConstants(); | |||
}; | |||
|
|||
struct U_I18N_API ConversionInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Observation: maybe we will eventually need a sourceOffset and a targetOffset here: it gives us the chance to produce cleaner formulas (e.g. "(5°F − 32) × 5/9 = -15°C").
(Since CLDR does not have separate source and target conversion data and this is just an internal API anyway, this is presently just a design discussion.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acknowledges :)
new TestData( | ||
"celsius", | ||
"fahrenheit", | ||
9.0 / 5.0, 32, false), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new TestData( | |
"celsius", | |
"fahrenheit", | |
9.0 / 5.0, 32, false), | |
new TestData( | |
"celsius", | |
"fahrenheit", | |
9.0 / 5.0, 32, false), | |
new TestData( | |
"fahrenheit", | |
"fahrenheit", | |
1.0, 0, false), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added it
I've also changed the PR description, since "extract conversion info" made me wonder "to where?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
(at fc94025)
fc94025
to
0bbd463
Compare
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
Closes: icu-units#24
Checklist