c# 類型轉換string To float

一、 string To float 簡單的例子: float x = 3.14F; string s = x.ToString(); string s = "3.14"; float x = float.Parse(s); 精度問題: float x = float.Parse(s); 在提交小數的時候會出現精度丟失問題,  若是是0.5則沒有問題 數據庫中也是0.5,可是提交其餘小數像 0.2
相關文章
相關標籤/搜索