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

Convert to string notation required for auto precision #31

Open
ppKrauss opened this issue Nov 28, 2018 · 2 comments
Open

Convert to string notation required for auto precision #31

ppKrauss opened this issue Nov 28, 2018 · 2 comments

Comments

@ppKrauss
Copy link

It is possible to change

    if (typeof(latitude) === 'number' || typeof(longitude) === 'number') {
      throw new Error('string notation required for auto precision.');
    }

To something like

    if (typeof(latitude) === 'number') {
      latitude = parseFloat(latitude).toString();
    }
    if (typeof(longitude) === 'number') {
      longitude = parseFloat(longitude).toString();
    }

or direct enforce input.toString(), without checks or parseFloats.

@sunng87
Copy link
Owner

sunng87 commented Nov 28, 2018

I'm not sure if parseFloat returns correct precision as user want. Explicitly disable this indecisive behavior is preferred.

@ppKrauss
Copy link
Author

can you show an example? I not see the problem...

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

No branches or pull requests

2 participants