Boost logo

Boost Users :

Subject: [Boost-users] [locale] boost::locale::format number formatting on OS X and Windows
From: Michael Smith (michael.smith_at_[hidden])
Date: 2016-01-20 19:02:02


Using Boost.Locale from Boost 1.60.0 (installed via homebrew, so it uses
icu) on Mac OS X 10.11.2, I seem to be getting unexpected behavior for some
of the boost::format number formatting. A short example program

#include <boost/locale.hpp>

int main(int argc, char** argv)
{
    boost::locale::format fmt("{1,number} should be 1,25.");
    fmt % 1.25;
    boost::locale::generator gen;
    std::cout << fmt.str(gen("fr-fr.UTF-8")) << std::endl;
    return 0;
}

That produces 1,25 on Linux, and 1.25 on Windows (using mingw-w64) and Mac.
Any idea why they'd represent it differently?



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net