Browse Source

Set locale for display of numerical values - otherwise, e.g. with LANG=de_DE.UTF-8, probabilities will be exported in the form 0,5 not 0.5 (reported by Joacim Klein).

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@9994 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 11 years ago
parent
commit
523d73a8ea
  1. 5
      prism/src/prism/PrismNative.cc

5
prism/src/prism/PrismNative.cc

@ -28,6 +28,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <limits.h> #include <limits.h>
#include <locale.h>
#include "PrismNativeGlob.h" #include "PrismNativeGlob.h"
#include "jnipointer.h" #include "jnipointer.h"
@ -75,6 +76,10 @@ JNIEXPORT void JNICALL Java_prism_PrismNative_PN_1SetPrism(JNIEnv *env, jclass c
prism_obj = env->NewGlobalRef(prism); prism_obj = env->NewGlobalRef(prism);
// get the class and make a global reference to it // get the class and make a global reference to it
prism_cls = (jclass)env->NewGlobalRef(env->GetObjectClass(prism_obj)); prism_cls = (jclass)env->NewGlobalRef(env->GetObjectClass(prism_obj));
// We should also set the locale, to ensure consistent display of numerical values
// (e.g. 0.5 not 0,5). This seems as good a place as any to do it.
setlocale(LC_NUMERIC, "C");
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

Loading…
Cancel
Save