Hi,
I am playing with the following C++ piece of code (*). At least on
my system debian/gcc 4.3 it looks like I am not writing out a floating
point separator as a comma. what are the operation affected by the
LC_NUMERIC env var value ?
Thanks
-Mathieu
(*)
#include <sstream>
#include <iostream>
#include <stdlib.h>
int main(int argc, char *argv[])
{
setenv("LC_NUME RIC", "fr_FR", 1);
std::ostringstr eam os;
double d = 1.2;
os << d;
std::string s = os.str();
std::cout << s << std::endl;
std::string::si ze_type pos_comma = s.find( "," );
if( pos_comma != std::string::np os )
{
return 1;
}
std::string::si ze_type pos_dot = s.find( "." );
if( pos_dot == std::string::np os )
{
return 1;
}
std::cout << "dot found" << std::endl;
return 0;
}
I am playing with the following C++ piece of code (*). At least on
my system debian/gcc 4.3 it looks like I am not writing out a floating
point separator as a comma. what are the operation affected by the
LC_NUMERIC env var value ?
Thanks
-Mathieu
(*)
#include <sstream>
#include <iostream>
#include <stdlib.h>
int main(int argc, char *argv[])
{
setenv("LC_NUME RIC", "fr_FR", 1);
std::ostringstr eam os;
double d = 1.2;
os << d;
std::string s = os.str();
std::cout << s << std::endl;
std::string::si ze_type pos_comma = s.find( "," );
if( pos_comma != std::string::np os )
{
return 1;
}
std::string::si ze_type pos_dot = s.find( "." );
if( pos_dot == std::string::np os )
{
return 1;
}
std::cout << "dot found" << std::endl;
return 0;
}
Comment