mrsiro > 19-12-17, 04:46 PM
duynamvnn1208 > 19-12-17, 05:32 PM
mrsiro > 19-12-17, 05:45 PM
ongke0711 > 19-12-17, 09:35 PM
Function DynamicDec(ByVal Num As Double) As Double
Dim DecimalLen As Integer
DecimalLen = Len(CStr(Num)) - InStr(CStr(Num), ".")
'Debug.Print DecimalLen'
Select Case DecimalLen
Case Is >= 4
DynamicDec = Format(Num, "#,##0.0000")
Case Is = 3
DynamicDec = Format(Num, "#,##0.000")
Case Is <= 2
DynamicDec = Format(Num, "#,##0.00")
End Select
End Function
duynamvnn1208 > 20-12-17, 09:54 AM