Closed cloneofghosts closed 1 year ago
Hi, thanks for noticing this! It might seem small thing, but the entire point of this project is providing a consistent, clear, and documented weather API, and rounding is an important part of that.
I'll flag this for the next time I'm making an update, and report back here when it's complete.
Awesome thanks. I figured it wouldn't be super important but would need to be done for consistency.
I'm going to combine #7 Parameters sometimes return -0.0 into this issue since they're both pretty minor things that don't really need to be in separate issues.
For that one some parameters return -0.0 when they should just return 0.0. You'd probably need to look through and make sure that those parameters don't go below 0.
I'm copying in an earlier comment I had about the rounding since I removed it: I'm not sure how DarkSky handles decimal points but I think decimals should always show two decimal points even if the last decimal point is zero. So as an example 50% cloud cover would show as 0.50 instead of 0.5.
@alexander0042 Just putting it back on your radar in case you've forgotten about it.
I wonder if precipIntensity
and precipAccumulation
should be rounded to four decimal places like on the minutely
section. I think that's what DarkSky did and I know that some other sites round it to four decimal places.
EDIT: #36 should probably be looked at as well while fixing rounding since it's related to these issues.
Everything seems to be fixed now so will close this issue.
I know this is probably pretty picky and is something that has been bugging me for a while but some of the fields in the API either don't have any rounding or round to three decimal places instead of two.
I know that the precip fields outside of the daily block don't have any rounding applied to them and neither do the moonPhase on the daily block. windSpeed in the current block and I know that humidity and cloudCover on daily all around to three decimial points instead of rounding to three like the other fields do. Not sure about Time Machine but there is this comment from last December which points out the issue with the fields on Time Machine.
This obviously doesn't need to be very high priority but maybe something to work on in the background for a 1.2 release?