开发者

How to convert a formatted string to float in java with different locales?

I have a number with string type e.g. "1,000.00" in (EN) and the same value "1 000,00" i开发者_高级运维n (FR).

how can I convert this string to float (e.g. 1000.00).

is there a method to do this in java or do I have to implement a getFloat(str,locale) my self.

Thanks


DecimalFormat will do it. Read this tutorial for details.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜