summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
authorGiles Bathgate <gilesbathgate@gmail.com>2011-02-05 19:02:50 (GMT)
committerGiles Bathgate <gilesbathgate@gmail.com>2011-02-05 19:02:50 (GMT)
commite0534ee78138a12464d3c37b51678291778d6a51 (patch)
tree13e074d21e84669b6ed9349bf3b4948fbc4e093b /src/value.cc
parent744367fda10a756de7da503ff833fe3d75bd3dfc (diff)
Dump number values with correct precision.
You might want to apply this patch so that the output of echo($pi) is not truncated.
Diffstat (limited to 'src/value.cc')
-rw-r--r--src/value.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/value.cc b/src/value.cc
index 92aaff1..b5c4afe 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -324,6 +324,7 @@ void Value::reset_undef()
std::string Value::toString() const
{
std::stringstream stream;
+ stream.precision(16);
switch (this->type) {
case STRING:
@@ -338,9 +339,13 @@ std::string Value::toString() const
stream << ']';
break;
case RANGE:
- stream << "[ "
- << this->range_begin << " : " << this->range_step << " : " << this->range_end
- << " ]";
+ stream << "[ "
+ << this->range_begin
+ << " : "
+ << this->range_step
+ << " : "
+ << this->range_end
+ << " ]";
break;
case NUMBER:
stream << this->num;
contact: Jan Huwald // Impressum