【发布时间】:2021-08-02 05:22:08
【问题描述】:
我有一个 editText,起始值为 0.00 美元。当您按 1 时,它会变为 0.01 美元。按 4,价格为 0.14 美元。按 8,按 0,然后按 1.40,1.48 美元。按退格键、0.14 美元等。 谁能帮我 我在下面使用
System.String ss = editText.Text.ToString();
System.String cleanString = inputKey.Replace("[$,.]", "");
double parsed = Convert.ToDouble(cleanString);
double currentd = Convert.ToDouble(current);
System.String formatted = System.String.Format((parsed / 100).ToString());
double formattedd = Convert.ToDouble(formatted);
currentd = currentd * 10;
double pp = currentd + formattedd;
current = pp.ToString();
editText.Text = pp.ToString();
【问题讨论】:
标签: c# xamarin xamarin.android