开发者

Convert a double to a SQL-friendly string on Android?

开发者 https://www.devze.com 2022-12-23 01:34 出处:网络
My open-source Android application uses this开发者_如何学运维 in an SQL query: String.format(\"%f\", someDoubleValue);

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

精彩评论

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