Skip to content

Commit

Permalink
Force US locale for createdTime, to avoid bug where a comma is used a…
Browse files Browse the repository at this point in the history
…s the decimal separator in some Locales.
  • Loading branch information
alanlgardner committed Apr 10, 2013
1 parent 914d6ab commit 2db9429
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/edu/mit/media/funf/storage/NameValueDatabaseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.UUID;

import android.content.Context;
Expand Down Expand Up @@ -74,7 +75,7 @@ public void onCreate(SQLiteDatabase db) {
String installationUuid = UuidUtil.getInstallationId(context);
String fileUuid = UUID.randomUUID().toString();
double createdTime = TimeUtil.getTimestamp().doubleValue();
db.execSQL(String.format("insert into %s (%s, %s, %s, %s) values ('%s', '%s', '%s', %f)",
db.execSQL(String.format(Locale.US, "insert into %s (%s, %s, %s, %s) values ('%s', '%s', '%s', %f)",
FILE_INFO_TABLE.name,
COLUMN_DATABASE_NAME, COLUMN_INSTALLATION, COLUMN_UUID, COLUMN_CREATED,
databaseName, installationUuid, fileUuid, createdTime));
Expand Down

0 comments on commit 2db9429

Please sign in to comment.