~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/string_functions/format.cc

  • Committer: Barry.Leslie at PrimeBase
  • Date: 2011-01-22 03:22:44 UTC
  • mfrom: (2101 staging)
  • mto: (2228.1.4 build)
  • mto: This revision was merged to the branch mainline in revision 2230.
  • Revision ID: barry.leslie@primebase.com-20110122032244-ukbe3mlj7fs8xph6
Merged with lp:drizzle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
75
75
  if (args[0]->result_type() == DECIMAL_RESULT ||
76
76
      args[0]->result_type() == INT_RESULT)
77
77
  {
78
 
    my_decimal dec_val, rnd_dec, *res;
 
78
    type::Decimal dec_val, rnd_dec, *res;
79
79
    res= args[0]->val_decimal(&dec_val);
80
80
    if ((null_value=args[0]->null_value))
81
81
      return 0;
82
 
    my_decimal_round(E_DEC_FATAL_ERROR, res, dec, false, &rnd_dec);
83
 
    my_decimal2string(E_DEC_FATAL_ERROR, &rnd_dec, 0, 0, 0, str);
 
82
    class_decimal_round(E_DEC_FATAL_ERROR, res, dec, false, &rnd_dec);
 
83
    class_decimal2string(E_DEC_FATAL_ERROR, &rnd_dec, 0, 0, 0, str);
84
84
    str_length= str->length();
85
85
    if (rnd_dec.sign())
86
86
      str_length--;