|
ListViewItem lvi = new ListViewItem(String.Format("{0:C}", drow["Price"].ToString()));
I believe.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hmm... Doesn't appear to be working. Still doesn't show the $ sign.
I appreciate your help
|
|
|
|
|
|
Comes up with "no overload for method 'ToString' takes '1' arguments"
|
|
|
|
|
OK, that'll be because it's an object coming out of the DB
ListViewItem lvi = new ListViewItem(Convert.ToDouble(drow["Price"]).ToString("C")));
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
I got it to work by using:
double dbprice = Convert.ToDouble(drow["Price"]);
ListViewItem lvi = new ListViewItem(dbprice.ToString("C"));
Perhaps you can't convert it twice in one line of code?
Thanks for your help Chris
|
|
|
|
|
object o = 2.56;
string s = Convert.ToDouble(o).ToString("C");
This code works. If your code is crashing, then there's some other problem here. At some point, you need to write your own code - the ToString method on a double which takes a letter will produce a currency output as you're seeing here. You need to look into what's coming out of your database and make it work with this method.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sorry, what code can i use to remove the cents from the value.
Something to do with the NumberFormatInfo ??
|
|
|
|
|
If you want to remove the cents ( sorry, did you say that ? ) then build your own format string using the info on those pages. You'd then be locale independent, i.e. it would always say $.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yeah, thanks, figured it out and all is working ok
Thanks for your time.
|
|
|
|
|
Christian Graus wrote: I believe.
Been watching The Matrix again?
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
i dont mind to be
a stupid,better than being a moron - Adnan Siddiqi.
|
|
|
|
|
I would like to know if anybody have used the new serialport class available in the new Dotnet framework V2.
If yes, I would like to know if some events like :
- RX buffer is empty or not;
- TX buffer is empty;
- Time Out expired;
- ...
If I can retreive the size of the RX/TX buffer and many other parameters.
Because now I using my wrapper class of serialport (c++ to C#) but sometimes it is difficult to realize some functionality.
Best Regards
youssef
|
|
|
|
|
Hi
I know that it may be a big question but I need its answer because it will help me in my graduation project.
My question is how to build a speech recognition engine?? It is a part of the project so I just want the steps to follow to build it.
Thank you
Fox
|
|
|
|
|
are you implying building an engine from scratch ? i would highly recommend reading this
Fundamentals of Speech Recognition by "Lawrence R. R. Rabiner & Biing-Hwang Juang". They talk about using hidden markov models as the basis of a speech recognition engine. This is one of the most highly recommended texts as an introduction into speech recognition. I hope your DSP is up to scratch
Alternatively, you can try looking up IEEE Xplorer for recent IEEE transactions journals on speech recognition.
|
|
|
|
|
Someone voted you a 2 ? I thought this was VERY helpful advice.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote: I thought this was VERY helpful advice
So did I.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
here is HMM toolkit you can use
http://www.cs.ubc.ca/~murphyk/Software/HMM/hmm.html
However, its written using matlab which is a piece of cake to understand. Though the difficulty will come in understanding the mathematics of hidden markov models and its other foundations.
Only a 2 crikey, i practically gave you the solution to your project.
|
|
|
|
|
You may want to reply to the OP so he gets an email notification of your reply. Then again, if he isn't interested then I doubt it would make much difference.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
thank you so much.
Fox
|
|
|
|
|
Hi
I'm sooooo sorry but i pressed 2 by mistake so i hope that you don't be upset sorry again and thank you soo much for helping ,now i'm searching to get the book and i think it will help me alot.
Fox
|
|
|
|
|
Can I somehow find out the total memory my Hashtable uses?
c# example code would be really nice.
|
|
|
|
|
Hi!
currently I'm developing my own little mail server (SMTP and POP3).
It works fine so far, but I'm concerned about the speed of my application.
This is, what I use for sending a mail back to a client:
StreamReader lineReader = new StreamReader(new MemoryStream(mail.Data));
while((line = lineReader.ReadLine()) != null)
{
writer.Write(line + "\r\n");
writer.Flush();
}
Even when sending the mail locally via 127.0.0.1 the transfer is very slow, about 100-300Kb per second.
What are the problems here?
One problem I'm aware of is the string concatenation like line + "\r\n" . I think I need to use a StringBuilder here, but how to use it correctly in this loop?
Does anyone see any other performance hits here?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
First of all, unstead of \r\n, use Environment.NewLine. Then, a stringbuilder gets created before the loop, you add your strings in the loop ( but add the newline on a seperate line, or you're still concatenating strings as you go ). Then use the ToString method to get your string at the end.
The calls to Flush are also expensive and unnecessary, flush once at the end if you need to.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote: First of all, unstead of \r\n, use Environment.NewLine.
The SMTP and POP3 protocols require data to be ended with CRLF, but some operating systems use something different as NewLine, so I do a "\r\n"
Christian Graus wrote: hen, a stringbuilder gets created before the loop, you add your strings in the loop ( but add the newline on a seperate line, or you're still concatenating strings as you go ). Then use the ToString method to get your string at the end.
That's what I just implemented. Looks like I had the same idea
Christian Graus wrote: The calls to Flush are also expensive and unnecessary, flush once at the end if you need to.
Won't this create a terribly large string in memory when I send mails with attachments of several megabytes in size?
Right now the client receives my mails with about 500-800Kbytes/sec, this is a little improvement, but I think this can be done faster.
Okay, using writer.Flush() after the loop makes the whole thing pretty fast, definately >1Mbyte/sec, but what about memory consumption?
regards
-- modified at 18:29 Sunday 22nd January, 2006
modified 12-Sep-18 21:01pm.
|
|
|
|