[glom/glom-1-12] Make the default precision used for stringstreams available for libglom users
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glom/glom-1-12] Make the default precision used for stringstreams available for libglom users
- Date: Tue, 19 Jan 2010 17:09:37 +0000 (UTC)
commit 96e9991d2990495612110a9689d221f514a02ebf
Author: Michael Hasselmann <michaelh openismus com>
Date: Thu Jan 14 12:14:53 2010 +0100
Make the default precision used for stringstreams available for libglom users
* glom/libglom/data_structure/glomconversions.[h|cc]
(get_stringstream_precision_default): Wrap the constant used into a function
and export it in the headers. Users of libglom need it to show the same
precision for Glom's numeric type.
ChangeLog | 9 +++++++++
glom/libglom/data_structure/glomconversions.cc | 7 +++++++
glom/libglom/data_structure/glomconversions.h | 2 ++
3 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 40df6e5..2b8b72d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,15 @@
* glom/libglom/data_structure/numeric_format.[h|cc]: and document it
vaguely.
+2010-01-14 Michael Hasselmann <michaelh openismus com>
+
+ Make the default precision used for stringstreams available for libglom users
+
+ * glom/libglom/data_structure/glomconversions.[h|cc]
+ (get_stringstream_precision_default): Wrap the constant used into a function
+ and export it in the headers. Users of libglom need it to show the same
+ precision for Glom's numeric type.
+
2010-01-14 Murray Cumming <murrayc murrayc com>
Minor simplification.
diff --git a/glom/libglom/data_structure/glomconversions.cc b/glom/libglom/data_structure/glomconversions.cc
index 1fdb10e..054b20e 100644
--- a/glom/libglom/data_structure/glomconversions.cc
+++ b/glom/libglom/data_structure/glomconversions.cc
@@ -55,6 +55,13 @@ namespace
namespace Glom
{
+
+int Conversions::get_stringstream_precision_default()
+{
+ static const int stringstream_precision_default = 15;
+ return stringstream_precision_default;
+}
+
Glib::ustring Conversions::format_time(const tm& tm_data)
{
return format_time( tm_data, std::locale("") /* the user's current locale */ ); //Get the current locale.
diff --git a/glom/libglom/data_structure/glomconversions.h b/glom/libglom/data_structure/glomconversions.h
index 868de48..dc79071 100644
--- a/glom/libglom/data_structure/glomconversions.h
+++ b/glom/libglom/data_structure/glomconversions.h
@@ -32,6 +32,8 @@ namespace Glom
namespace Conversions
{
+ int get_stringstream_precision_default();
+
///Get text for display to the user.
Glib::ustring get_text_for_gda_value(Field::glom_field_type glom_type, const Gnome::Gda::Value& value, const NumericFormat& numeric_format = NumericFormat());
Glib::ustring get_text_for_gda_value(Field::glom_field_type glom_type, const Gnome::Gda::Value& value, const std::locale& locale, const NumericFormat& numeric_format = NumericFormat(), bool iso_format = false);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]