Link to home
Start Free TrialLog in
Avatar of HKComputer
HKComputerFlag for United States of America

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.
ASKER CERTIFIED SOLUTION
Avatar of Shauli
Shauli

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hes
Try this

Dim MyNumber As Double
MyNumber = 1.9373
MyNumber = Left((Replace(MyNumber, ".", "") * 100), 3)
Avatar of HKComputer

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
Avatar of Shauli
Shauli

You are most welcome :)

S