On Mon, Apr 19, 2021 at 5:09 PM Erich Steinböck <erich.steinbo...@gmail.com> wrote:
> Hi Ruurd, instead of defining your latitude/longitude arguments as CSTRING > and then manually converting them, you can define your arguments as (e. g.) > float and have Rexx do the conversion for you. > > ~~~ > float lat, // Latitude in decimal degrees > float lon, // Longitude in decimal degrees > ~~~ > > The actual issue may be a bug as ObjectToDouble calls C's strtod() which > seems to adhere to the locale (decimal dot vs decimal comma). > It seems rexx doesn't globally set the "C" locale but runs with whatever > locale it is being started in. > I suspect that is the case. The actual work is done in method NumberString::doubleValue(), which uses strtod() to do the conversion. Since the numberstring object already has already parsed off the matissa, exponent, and sign, it should not be difficult to directly generate a double value from that information. Rick > > Does it work as expected if you run your script in either of these two > forms? > LANG=C rexx <name.rex> > LC_NUMERIC=C rexx <name.rex> > _______________________________________________ > Oorexx-devel mailing list > Oorexx-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/oorexx-devel >
_______________________________________________ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel