Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/test/c/snprintf1.c # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / test / c / snprintf1.c` 18 lines ยท 489 bytes Raw Blame History 1 #include "sqlite3.h" 2 #include 3 4 int main(void) { 5 const char *zExpect = "2023.000"; 6 char szBuffer[32]; 7 double val = 2023.0; 8 #ifdef SQLITE_OMIT_AUTOINIT 9 sqlite3_initialize(); 10 #endif 11 sqlite3_snprintf(17, szBuffer, "%.3f", val); 12 printf("size 17: '%s'\n", szBuffer); 13 if( sqlite3_stricmp(zExpect, szBuffer) ) return 1; 14 sqlite3_snprintf(16, szBuffer, "%.3f", val); 15 printf("size 16: '%s'\n", szBuffer); 16 if( sqlite3_stricmp(zExpect, szBuffer) ) return 1; 17 return 0; 18 }