mirror of
https://github.com/sqlite/sqlite.git
synced 2025-10-24 09:53:10 +03:00
Code cleanup in the date and time functions. (CVS 1263)
FossilOrigin-Name: 9b3bcde1530091602e551435ffd7820eb79727d5
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
|
||||
** All other code has file scope.
|
||||
**
|
||||
** $Id: func.c,v 1.40 2004/02/20 22:53:39 rdc Exp $
|
||||
** $Id: func.c,v 1.41 2004/02/22 17:49:34 drh Exp $
|
||||
*/
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
@@ -147,7 +147,7 @@ static void roundFunc(sqlite_func *context, int argc, const char **argv){
|
||||
n = argc==2 ? atoi(argv[1]) : 0;
|
||||
if( n>30 ) n = 30;
|
||||
if( n<0 ) n = 0;
|
||||
r = sqliteAtoF(argv[0]);
|
||||
r = sqliteAtoF(argv[0], 0);
|
||||
sprintf(zBuf,"%.*f",n,r);
|
||||
sqlite_set_result_string(context, zBuf, -1);
|
||||
}
|
||||
@@ -408,7 +408,7 @@ static void sumStep(sqlite_func *context, int argc, const char **argv){
|
||||
if( argc<1 ) return;
|
||||
p = sqlite_aggregate_context(context, sizeof(*p));
|
||||
if( p && argv[0] ){
|
||||
p->sum += sqliteAtoF(argv[0]);
|
||||
p->sum += sqliteAtoF(argv[0], 0);
|
||||
p->cnt++;
|
||||
}
|
||||
}
|
||||
@@ -446,7 +446,7 @@ static void stdDevStep(sqlite_func *context, int argc, const char **argv){
|
||||
if( argc<1 ) return;
|
||||
p = sqlite_aggregate_context(context, sizeof(*p));
|
||||
if( p && argv[0] ){
|
||||
x = sqliteAtoF(argv[0]);
|
||||
x = sqliteAtoF(argv[0], 0);
|
||||
p->sum += x;
|
||||
p->sum2 += x*x;
|
||||
p->cnt++;
|
||||
|
||||
Reference in New Issue
Block a user