在論壇碰到有人問一個問題,
『查詢同一廠商同一料號,如果連續五次無退貨資料就顯示,
但是如果有退貨資料次數就需要重新計算』
這個用到了『判斷是不是連續整數的』用法。
『查詢同一廠商同一料號,如果連續五次無退貨資料就顯示,
但是如果有退貨資料次數就需要重新計算』
這個用到了『判斷是不是連續整數的』用法。
vb.net
Function Dec3(n As String)
Dim num As UInt32 = UInt32.Parse(n, System.Globalization.NumberStyles.AllowHexSpecifier)
Dim floatVals As Byte() = BitConverter.GetBytes(num)
Dim f As Single = BitConverter.ToSingle(floatVals, 0)
Return f
End Function
String hexString = "43480170";
uint num = uint.Parse(hexString, System.Globalization.NumberStyles.AllowHexSpecifier);
Byte[] floatVals = BitConverter.GetBytes(num);
float f = BitConverter.ToSingle(floatVals, 0);
Console.WriteLine("float convert = {0}", f);