473,322 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

splitting a double

hello prof.

What is the best way to split a double so that I can count the value before
the comma and after the comma?

example

123,1234

intbefore = total(before) '123
intafter = total(after) '1234
Nov 21 '05 #1
2 870
Mat
Dim
s()=mydouble.tostring(System.Globalization.Culture Info.invariantculture).split(".")
If s.lenght>0 then
intafter=s(1).lenght
intbefore=s(0).lenght
else
intafter=0
intbefore=s(0).lenght
end if

"steve" <st***@discussions.microsoft.com> wrote in message
news:ED**********************************@microsof t.com...
hello prof.

What is the best way to split a double so that I can count the value
before
the comma and after the comma?

example

123,1234

intbefore = total(before) '123
intafter = total(after) '1234

Nov 21 '05 #2
Mat,

Very nice, however why not after that nice split that you do where you keep
track of the cultures, this simple one?

\\\
dim s() as string = _
(123.1234).tostring(System.Globalization.CultureIn fo.invariantculture).split(".")
Dim a1 As Integer = CInt(s(0))
Dim a2 As Integer = CInt(s(1))
////

Cor
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: J. W. McCall | last post by:
Hello, I need to split a string as per string.strip(), but with a modification: I want it to recognize quoted strings and return them as one list item, regardless of any whitespace within the...
10
by: Mark Harrison | last post by:
What is the best way to process a text file of delimited strings? I've got a file where strings are quoted with at-signs, @like this@. At-signs in the string are represented as doubled @@. ...
13
by: James Conrad St.John Foreman | last post by:
One of the larger tables in our database is now 6.8 million rows (1 per financial transaction since 2000). Every time an amendment is made to a booking, new rows are added to the table for each...
2
by: Trint Smith | last post by:
Ok, My program has been formating .txt files for input into sql server and ran into a problem...the .txt is an export from an accounting package and is only supposed to contain comas (,) between...
3
by: H.B. | last post by:
Hi, How can I split Double into two integers like the following example : 2.34 -> 2 and 34 (I dont want the modf() result that gives 2 and 0.34) Hugo
4
by: VMI | last post by:
How can I split a string that looks like this: John, Doe, 37282, box 2, 10001, "My description, very important", X, Home If I use String.Split(), it'll split the string that's between the...
2
by: CharChabil | last post by:
Using Vb.net 2005, I want to read each part in this string in an array (splitting the string) ----------- A1/EXT "BK82 LB73 21233" 105 061018 1804 ----------- That Code that i used is as follow:...
6
by: HMS Surprise | last post by:
The string s below has single and double qoutes in it. For testing I surrounded it with triple single quotes. I want to split off the portion before the first \, but my split that works with...
2
by: shadow_ | last post by:
Hi i m new at C and trying to write a parser and a string class. Basicly program will read data from file and splits it into lines then lines to words. i used strtok function for splitting data to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.