Date: Tuesday, March 7, 2006 @ 12:48:25
Author: gilles
Path: /cvsroot/carob/carob
Modified: src/BigDecimal.cpp (1.18 -> 1.19)
test/30-ResultSet/TestBigDecimal.cpp (1.2 -> 1.3)
Get the current locale instead of the default one
--------------------------------------+
src/BigDecimal.cpp | 3 +--
test/30-ResultSet/TestBigDecimal.cpp | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
Index: carob/src/BigDecimal.cpp
diff -u carob/src/BigDecimal.cpp:1.18 carob/src/BigDecimal.cpp:1.19
--- carob/src/BigDecimal.cpp:1.18 Tue Mar 7 12:29:39 2006
+++ carob/src/BigDecimal.cpp Tue Mar 7 12:48:25 2006
@@ -160,8 +160,7 @@
//Add the '.' TODO: get this separator from locale
if (sRet.length()-scale > 0 && scale != 0)
{
- //FIXME: get the current local instead of default
- wchar_t decimal_point = std::use_facet<std::numpunct<wchar_t>
>(std::locale("")).decimal_point();
+ wchar_t decimal_point = std::use_facet<std::numpunct<wchar_t>
>(std::locale()).decimal_point();
sRet.insert(sRet.length()-scale, 1, decimal_point);
}
if (signum < 0)
Index: carob/test/30-ResultSet/TestBigDecimal.cpp
diff -u carob/test/30-ResultSet/TestBigDecimal.cpp:1.2
carob/test/30-ResultSet/TestBigDecimal.cpp:1.3
--- carob/test/30-ResultSet/TestBigDecimal.cpp:1.2 Tue Mar 7 12:29:39 2006
+++ carob/test/30-ResultSet/TestBigDecimal.cpp Tue Mar 7 12:48:25 2006
@@ -103,10 +103,10 @@
logInfo(fctName, toWString(numeric_limits<long long>::max()) + L" -
getAsString=" + drsPtr->getAsString(3));
CPPUNIT_ASSERT(drsPtr->getAsString(3) == toWString(numeric_limits<long
long>::max()));
drsPtr->next();
- logInfo(fctName, wstring(L"-123456789012345678901234567890") +
use_facet<numpunct<wchar_t> >(std::locale("")).decimal_point() +
L"123456789012345678901234567890 - getAsString=" + drsPtr->getAsString(3));
+ logInfo(fctName, wstring(L"-123456789012345678901234567890") +
use_facet<numpunct<wchar_t> >(std::locale()).decimal_point() +
L"123456789012345678901234567890 - getAsString=" + drsPtr->getAsString(3));
CPPUNIT_ASSERT(drsPtr->getAsString(3) == L"-123456789012345678901234567890"
+ fromString(localeconv()->decimal_point) + L"123456789012345678901234567890");
drsPtr->next();
- logInfo(fctName, wstring(L"123456789012345678901234567890") +
use_facet<numpunct<wchar_t> >(std::locale("")).decimal_point() +
L"123456789012345678901234567890 - getAsString=" + drsPtr->getAsString(3));
+ logInfo(fctName, wstring(L"123456789012345678901234567890") +
use_facet<numpunct<wchar_t> >(std::locale()).decimal_point() +
L"123456789012345678901234567890 - getAsString=" + drsPtr->getAsString(3));
CPPUNIT_ASSERT(drsPtr->getAsString(3) == L"123456789012345678901234567890" +
fromString(localeconv()->decimal_point) + L"123456789012345678901234567890");
}
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits