Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

don't cast F2C conversion to int #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

don't cast F2C conversion to int #153

wants to merge 1 commit into from

Conversation

aesthetic
Copy link
Contributor

prevents rounding errors that show the wrong emoji when displaying temp as Celsius

prevents rounding errors that show the wrong emoji when displaying temp as Celsius
Copy link
Member

@kpengboy kpengboy left a comment

Choose a reason for hiding this comment

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

Have you tested to make sure that this doesn't display 10 digits of (unwanted) precision when someone requests a temperature in Celsius? EDIT: nvm second inspection shows it wouldn't happen

On a larger note though, I think the organization of code in this module is flawed and bug-prone. IMO icon should require the caller to pass Fahrenheit temperatures, and color should convert Celsius to Fahrenheit before figuring out which bucket the temperature belongs in.

@kpengboy
Copy link
Member

I would prefer the methodology of PR #154. (In any case though, thanks for the contribution.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants