HKComputer
asked on
Need to remove period from number/currency
I'm using VB6.
I need a function to take the following currency values:
2
5.5
1.83
4.4444
5.67
5.5
1.9373
And return the following:
200
550
183
444
567
550
194
Any suggestions where to start? I need to test for the location of the period and see how many digits are on the right side. I don't care if they are rounded up or not. To be off one cent in this case will not matter.
I need a function to take the following currency values:
2
5.5
1.83
4.4444
5.67
5.5
1.9373
And return the following:
200
550
183
444
567
550
194
Any suggestions where to start? I need to test for the location of the period and see how many digits are on the right side. I don't care if they are rounded up or not. To be off one cent in this case will not matter.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Shauli, you are a genius. I would have never thought of such a simple approach. I have it installed and working well with your solution. Thanks -HK
You are most welcome :)
S
S
Dim MyNumber As Double
MyNumber = 1.9373
MyNumber = Left((Replace(MyNumber, ".", "") * 100), 3)