I want to split a value like 150.87 to two different variables a = 150 and b= .87
i want to separate the decimal portion of the value.
Please guide me that how can i do it in VB6.
Printable View
I want to split a value like 150.87 to two different variables a = 150 and b= .87
i want to separate the decimal portion of the value.
Please guide me that how can i do it in VB6.
IPart = Fix(Value)
FPart = Value - IPart
If you will have negative values, please indicate how you want them treated, for example, -3.5:
Code:IPart | FPart
-3 | -0.5
3 | 0.5
-3 | 0.5
Many ways to skin this cat
MsgBox x - Int(x)
@Martin: That is identical to my code with positive values, but returns undesireable results with negative values.
You're right.Quote:
Originally Posted by Logophobic
MsgBox Abs(x) - Int(Abs(x)) :)