我有這行代碼:奇怪解析雙行爲
return (this.pretWithoutDiscount/Double.Parse(UtilsStatic.getEuroValue())).ToString("N2") + "€";
在調試模式下我測試,值是:
UtilsStatic.getEuroValue()= 「4.1878」
this.pretWithoutDiscount = 111.0
誰能explaing WHY:
Double.Parse(UtilsStatic.getEuroValue())= 41878.0
當它應該是4.1878?
謝謝...
PS:UtilsStatic.getEuroValue返回一個字符串。
如果使用InvariantCulture會發生什麼? – 2010-05-17 20:17:35