开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜