|
|
| version 1.2, 2001/03/06 14:09:35 | version 1.3, 2001/03/06 14:28:34 |
|---|---|
| Line 8 | Line 8 |
| #include "pa_value.h" | #include "pa_value.h" |
| #include "pa_common.h" | #include "pa_common.h" |
| #define MAX_DOUBLE_STRING 20 | #define MAX_DOUBLE_AS_STRING 20 |
| class VDouble : public Value { | class VDouble : public Value { |
| public: // Value | public: // Value |
| Line 17 public: // Value | Line 17 public: // Value |
| const char *type() const { return "Double"; } | const char *type() const { return "Double"; } |
| // double: value | // double: value |
| String *get_string() { | String *get_string() { |
| char *buf=static_cast<char *>(pool().malloc(MAX_DOUBLE_STRING)); | char *buf=static_cast<char *>(pool().malloc(MAX_DOUBLE_AS_STRING)); |
| snprintf(buf, MAX_DOUBLE_STRING, "%f", value); | snprintf(buf, MAX_DOUBLE_AS_STRING, "%g", value); |
| String *result=NEW String(pool()); | String *result=NEW String(pool()); |
| result->APPEND_CONST(buf); | result->APPEND_CONST(buf); |
| return result; | return result; |