-1
刪除逗號我有一個字符串,它顯示了一個逗號分隔符這樣一個數字:如何在一個字符串
DecimalFormat formatter = new DecimalFormat("#,###.000000");
String toDouble=formatter.format(amount);
現在我想刪除BO類逗號做算術運算。我使用這種格式:
StrCash_price_deal = StrCash_price_deal.replace(",", "");
double d = Double.valueOf(StrCash_price_deal.trim()).doubleValue();
但它將值更改爲零! 我的技術是struts2
可能重複:http://stackoverflow.com/questions/11981361/comma-separator-in-a-string-variable – adatapost 2012-08-16 08:17:14
在你的最後一個問題[](HTTP ://stackoverflow.com/questions/11981361/comma-separator-in-a-string-variable)你想添加逗號。現在你想刪除它們。也許你應該描述你實際上想要實現的目標...... – maba 2012-08-16 08:18:07
是的,我的客戶希望在逗號分隔中看到數字,但我必須對它進行算術運算,所以我必須刪除逗號 – AFF 2012-08-16 08:20:58