Boost logo

Boost :

Subject: Re: [boost] [convert] coversion between strings with different locales
From: Vladimir Batov (batov_at_[hidden])
Date: 2009-07-09 04:13:43

> From: "vicente.botet" <vicente.botet_at_[hidden]>
> I wanted to see how we can convert a double from a locale to another
> locale?
> ...

OTOH, I'd say

string en_double = ...;
double d = convert<double>::from(en_str)(locale_=en_locale);
string fr_double = convert<string>::from(d)(locale_=fr_locale);

If you want to stitch it all together, it becomes a scary

string fr_double =

or as scary

string fr_double =

If needed, I'd probably wrap it up in a function like

template<class T>
T convert(T const&, locale const&, locale const&);


Boost list run by bdawes at, gregod at, cpdaniel at, john at