如何将QString转换为十进制数?
在C#代码中,它看起来像这样:
public static decimal ConvertToDecimal(string tekst, bool upperOnly)
{
decimal num = 0m;
decimal num2 = 1m;
string text = upperOnly ? "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" : "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234";
int i = tekst.Length - 1;
while (i >= 0)
{
num += text.IndexOf(tekst[i]) * num2;
i--;
num2 *= text.Length;
}
return num;
}