~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/str/format.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-03-09 19:18:36 UTC
  • mfrom: (923 drizzle)
  • mto: (934.3.2 mordred)
  • mto: This revision was merged to the branch mainline in revision 938.
  • Revision ID: osullivan.padraig@gmail.com-20090309191836-ixiam3xa55off3do
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include <drizzled/server_includes.h>
 
21
#include <drizzled/function/str/format.h>
 
22
 
21
23
#include CSTDINT_H
22
 
#include CMATH_H
23
 
#include <drizzled/function/str/format.h>
 
24
#include <limits>
24
25
 
25
 
#if defined(CMATH_NAMESPACE)
26
 
using namespace CMATH_NAMESPACE;
27
 
#endif
 
26
using namespace std;
28
27
 
29
28
/**
30
29
  Change a number to format '3,333,333,333.000'.
97
96
    nr= my_double_round(nr, (int64_t) dec, false, false);
98
97
    /* Here default_charset() is right as this is not an automatic conversion */
99
98
    str->set_real(nr, dec, default_charset());
100
 
    if (isnan(nr))
 
99
    if (nr == numeric_limits<double>::quiet_NaN())
101
100
      return str;
102
101
    str_length=str->length();
103
102
    if (nr < 0)