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

Initial Map Position attribute does not support comma as decimal separator #21

Closed
godzillabytes opened this issue Oct 18, 2018 · 3 comments
Assignees
Labels

Comments

@godzillabytes
Copy link

I can only use whole number in Initial Map Position.
imagen

I seems that it depends on the values you got for nls_numeric_characters.
Using
show parameter nls_numeric_characters;
gives me
nls_numeric_characters string ,.
Because of that the following code breaks
l_lat := to_number(substr(l_latlong,1,instr(l_latlong,',')-1));
l_lng := to_number(substr(l_latlong,instr(l_latlong,',')+1));

It is because to_number expects an ',' and not a '.' as decimal seperator on my system.
I might just change the code to
l_lat := to_number(substr(l_latlong,1,instr(l_latlong,';')-1));
l_lng := to_number(substr(l_latlong,instr(l_latlong,';')+1));
Then I should be able to enter the values as follows:
-25,23414;-53,12341243

I guess you could make the decimal seperator and the seperator for longitude and latitude configurable. Or at least mention this limitation in the wiki (if it already is written there, I did not see it).
Thanks for the plugin!

Regards

Nils Stritzel

@jeffreykemp
Copy link
Owner

Hi Nils,

Thanks for raising this. I will look into whether using an alternative delimiter for the two numbers is a suitable solution - I suspect it would be.

In the meantime, another workaround is to use the period (.) as the decimal point, e.g.

-25.23414,-53.12341243

Cheers

@jeffreykemp jeffreykemp self-assigned this Oct 19, 2018
@jeffreykemp jeffreykemp changed the title Problem with Values in Initial Map Position Initial Map Position attribute does not support comma as decimal separator Oct 19, 2018
@godzillabytes
Copy link
Author

godzillabytes commented Oct 19, 2018

I guess the work around does not work, because that is how I started as I just copied a position I had gotten from google maps. Actually I don't mind putting a dot as decimal separator, but if I put -25.23414,-53.12341243 I get an error which I traced down to to_number.
On my system if I do the following

to_number('-25.0');

I get ORA-06502: PL/SQL: error : error de conversión de carácter a número numérico o de valor.

With
to_number('-25,0');
it works though. This is because it depends on the configuration of nls_numeric_characters.
Obviously I cannot insert the values like this -25,23414,-53,12341243 because the string is split on ','.
Anyway I just changed the following to lines of the plugin:
l_lat := to_number(substr(l_latlong,1,instr(l_latlong,';')-1));
l_lng := to_number(substr(l_latlong,instr(l_latlong,';')+1));

Now I can use the comma as decimal separator (which I have to due to the system configuration) as the string is split on the ';': -25,23414;-53,12341243
I hope this clarifies the issue a bit.

Thanks a lot for your efforts.

Cheers

@jeffreykemp
Copy link
Owner

I see - thanks for the clarification.

jeffreykemp added a commit that referenced this issue Apr 17, 2020
…ecimal separator #21; removed obsolete Google Signed-In parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants