Convert a double to a SQL-friendly string on Android?
My open-source Android application uses this开发者_如何学运维 in an SQL query:
String.format("%f", someDoubleValue);
Unfortunately, in some languages the coma is "," instead of "." and the SQL engine does not like it.
What is the best way to convert a double to a SQL-friendly string on Android?
My wild guess:
Locale nullLocale = null;
String.format(nullLocale, "%f", someDoubleValue);
I don't have any means to test it now, unfortunately.
精彩评论