Need to remove a character

maxxximaniac

Registered User.
Local time
Today, 15:22
Joined
Oct 22, 2004
Messages
80
Hello, Tried a search but could'nt come up with an answer.

I have a number field with an amount.
The format will always change as far as the LEN is concerned.
I need to remove the decimal.
There will always be 2 numbers to the right of the decimal but the left will always change.

Example:

21543.11 Need 2154311
11.20 Need 1120


Thanks in advance! :)
 
I think this will do it, but I haven't tested it yet:

Dim li_Original as Integer
Dim li_Start as Integer
Dim li_End as Integer
Dim li_Final as Integer

li_Original = 21543.11

li_End = Right(li_Original, 2)

li_Start = Left(li_Original, Len(li_Original) - 3)

li_Final = li_Start & li_End
 
Ah! I get the logic....
Works like a charm!

Thank you ;)
 
Hi -

Another method. From the debug window:

x = 21543.11
y = int(x * 100)
? y
2154311

Bob
 

Users who are viewing this thread

Back
Top Bottom