Skip to content
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

Round latitude, longitude to to two decimals #105

Closed
ghost opened this issue Aug 10, 2014 · 6 comments
Closed

Round latitude, longitude to to two decimals #105

ghost opened this issue Aug 10, 2014 · 6 comments

Comments

@ghost
Copy link

ghost commented Aug 10, 2014

Hi,

I noticed when playing with different locations around the world, some LAT:LON are getting changed, or additional numbers are being added on the end.

I'm using ~/.config/redshift.conf

In this screen shot below;

http://i.imgur.com/bWtVbLd.png

I'm using these lat:lon

lat=42.38
lon=83.08

Notice at the end it's adding on 0001 & 0002

In this screen shot below;

http://i.imgur.com/MPByV1Y.png

I'm using these lat:lon

lat=48.85
lon=2.33

Notice at the end it changed it from .85 to .849998

Hopefully this can be cleaned up in a future version so we see the LAT:LON as the actual numbers.

Thanks

@maandree
Copy link
Contributor

This would require redshift to keep track of when the position if given manually and when
it is provided by geoclue. I think it would be better to trim the output to 2 decimal positions.

@ghost
Copy link
Author

ghost commented Aug 11, 2014

I gave it manually in the config, so why wouldn't it just report what it's given?

Hmm

@maandree
Copy link
Contributor

Redshift converts it to floating point number and then those
values are printed and because computers have limited
accuracy it is often a bit of. If you use geoclue to get the
position it there will not be any written values and only
floating point values. So redshift has two alternatives:

  1. Always use the floating point values it has got by
    converting the values from the user or the values gives
    by geoclue.

  2. Use the values gives from the user when available
    and otherwise use the floating points from geoclue.

Option 1 is simpler but has the side effect that it may
be a bit off.

@ghost
Copy link
Author

ghost commented Aug 11, 2014

Ok I was only reporting this if there was a problem when putting in the lat:lon manually, I didn't know if it should be doing this...

thanks

@maandree
Copy link
Contributor

I guess not too much thought has been given to this,
but I think we should round the value to 2 decimal
positions.

@ghost
Copy link
Author

ghost commented Aug 11, 2014

ok thanks

@jonls jonls changed the title 1.9.1 GUI - Info (LAT:LON) Additional Numbers Added On... Round latitude, longitude to to two decimals Aug 13, 2014
@jonls jonls closed this as completed in 970e9dc Aug 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants