將數值進位或捨去至特定數值
vSource | Object | - | 必須 | (無) | 數值 | ||||||||||||
BiosValue | Double | 8 | 可省略 | 1 | 階梯函數的間距 | ||||||||||||
wFlags | enuStepGauss | 4 | 可省略 | SG_Normal | 數值進位旗標:
|
||||||||||||
BaseValue | Double | 8 | 可省略 | 0 | 基底,表對 0 的偏差 |
傳回 Double 數值
Debug.WriteLine(CValue(2.5, 4)) ' 傳回 4 Debug.WriteLine(CValue(2.5, 4, modMathTools.enuStepGauss.SG_Lower)) ' 傳回 0 Debug.WriteLine(CValue(2.5, 4, , 2)) ' 傳回 2 Debug.WriteLine(CValue(2.5, 4, modMathTools.enuStepGauss.SG_Upper, 2)) ' 傳回 6 Debug.WriteLine(CValue(2.58, 0.1)) ' 傳回 2.6 Debug.WriteLine(CValue(2.5, , modMathTools.enuStepGauss.SG_Upper)) ' 傳回 3
範例如圖,值 2.5 欲轉換至 0, 2, 3, 4, 6 之方法
Visual Studio .Net 2002 以後相容版本 | MathTool.vb
|