Writing GEO decimal seperator

Schnappi
2012-09-24
2012-09-24
  • Schnappi

    Schnappi - 2012-09-24

    While writing VCF's the GEO-coordinates are written like:
    GEO:46,300690;7,659110
    On my "Dutch localized Windows 7 PC" it looks as if it's using comma as decimal seperator (according to local nl default 1.234,567).
    This is not compatible with my Navigation system, it expects a period, which I suppose is the standard.
    Can I set this with some compatibility mode or would this be a bug?

    Schnappiroc

     
  • George_H

    George_H - 2012-09-24

    hi, this seems to be a bug on our side. We are using Java's number formatter to format the GEO decimals and we are taking the default locale. So I'll change it to take US locale by default.

    I'll push out a point release with this fix. Thanks for reporting this to me.

     
  • Schnappi

    Schnappi - 2012-09-24

    If I look at the code from VCardUtils correctly probably this line:

    private static NumberFormat GEO_NUM_FORMATTER = NumberFormat.getNumberInstance();

    Should give pass a local which makes sure of the correct formatting, in stead of the default locale.

     
  • Schnappi

    Schnappi - 2012-09-24

    LOL sametime response

     
  • George_H

    George_H - 2012-09-24

    I just committed the fix to the SVN. Do you wish to try it out before I make a release?

    This is the change

    private static NumberFormat GEO_NUM_FORMATTER = NumberFormat.getNumberInstance(Locale.US);

    UPDATE
    Can you try the attached file and tell me if it fixes your problem.

     
    Last edit: George_H 2012-09-24
  • Schnappi

    Schnappi - 2012-09-24

    Yes this fixes the problem, my Nav-system is happy now :-)

    Real QuickFix, thanks

     
  • George_H

    George_H - 2012-09-24

    :) I'm glad your nav-system is happy. I'll officially release this soon. Thanks for your help.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks