Change formatted values to non-formatted in VB prior saving

I have a VB6 app that saves a series of numeric values formatted on screen as "x,xxx.xx".  For example "2,222.00"  (2 decimal points and comma separator)

How can take out the format from the value previously saving it DB.  That is, if a value is "2,222.00", I want to change it to 2222 or "5.50" change it to 5.5.

In SQL, the columns are formatted as [money]

rayluvsAsked:
Who is Participating?
 
RPCITCommented:
try ...

Dim s As String
s = "$120.15"
Dim cc As Currency
cc = CCur(s)

Open in new window

0
 
RPCITCommented:
what variable type are you storing those values in?  if you are storing them in a string, then you will probably need to convert them to a numeric type.
0
 
rayluvsAuthor Commented:
The fields on screen are TextBox.

How do I convert them to numeric type?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
rayluvsAuthor Commented:
Seems that I have to have those lines for every field I'll save; there's over 100 fields.

Is there another way to save the value non-formatted (without the commas, $, etc.)
0
 
rayluvsAuthor Commented:
I also notice that a variable defined as Currency, when passing a value formatted, it stays woth that format
0
 
rayluvsAuthor Commented:
I think I got it.  I just added CCur("variable") right in the "update" line.  Didn;t have to use any other line per variables

What u think?
0
 
RPCITCommented:
that should work... my example multiple lines to give you context.
0
 
rayluvsAuthor Commented:
Thanx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.