|
no not showing digits...it's displaying same 1E+100.....
|
|
|
|
|
I just tried following code:
string str = double.MaxValue.ToString("f");
Works fine for me.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Thnx alot bro... it's workin great....but is there any way to get rid off those .00 at last....
|
|
|
|
|
sry lol....actually it's representing a fixed digit....not that number i wanted....
double dl = Math.pow(10,100);
i want to get dl in digits rather than E....and that max value one is showing some fixed digit that also float it has .00 at last....
|
|
|
|
|
This would help: Math.Pow(10, 100).ToString("f0");
The digit after "f" specifies number of digits after decimal.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
the thing you told is good for printing 1 and 0's only...try this
double dl = Math.Pow(10, 100);
double dll = dl + 21;
string ss = dll.ToString("f0");
Console.Write(ss);
Console.Read();
n tell how to work on that digit...it's not showing the change....
|
|
|
|
|
Hi,
your problem is not related to the formatting string in some ToString() method, it is much more fundamental.
real numbers are not capable of storing all the information that would be required to show all the digits of large numbers, that is exactly why they show at most 7 (float) or 16 (double) digits and tell you by which power of 10 the number needs to be multiplied.
integers keep all information accurately until they reach their maximum value; for int (Int32) that would be around 2 billion, much less than what you want. To store your 10^100 value as an integer, one would need over 300 bytes, whereas regular integers only hold 4 or 8 bytes of data.
decimals are somewhere in the middle, they won't solve it either.
What you need is some special type, often called BigInt, BigInteger, BigNumber; google for those. There are some articles here on CodeProject about them. And C# 4.0 holds a class that could help you.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Thnx alot....i don't wanna get into generating digits individually using multidimensional string array or char array and concatenating them......
|
|
|
|
|
Oh, and one more thing:
greendragons wrote: all numbers between 0 to 10 pow 100
assuming you meant integer numbers only, stored in memory this would take more memory than your system holds;
printed on paper this will take more paper than would fit in your house; and if you were to generate somehow say 10^50 numbers each second (not sure how you would do that with a CPU running at a few 10^9 instructions per second), it would take you 10^50 seconds, which is longer than the universe has existed till now.
So next time, do a little reality check before you set out for a project like this.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi,
Does anyone know where I can find a good spanish-english dictionary for use with c# (or any language even) in a translation project? I've spent a few hours looking around on google, but the best I could find was a pretty weak english-spanish file here: http://www.ilovelanguages.com/idp/IDPfiles.html
The dictionary needs to be under a licence that allows it to be used in a commercial app. If there is nothing freely available, does anyone how to go about licensing one?
Thanks in advance.
|
|
|
|
|
Shaunr88 wrote: Does anyone know where I can find ...
Google!
|
|
|
|
|
Unfortunately Google hasn't yielded a good solution. I was wondering if anyone else has worked on a project requiring foreign language dictionaries, and how they got them... For instance, talking with some of the companies that print them?
|
|
|
|
|
Hope your application runs independent of/on internet. else you can use google services to do all sorts of translations... using the googles translation api's. will this be a good solution?
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
i make a small program on my labtop with access as database but when i setup the program on me desktop some of the select statment that include SUM() COUNT() do not work it work well on my labtop but not on my desktop WHY?
|
|
|
|
|
Do you have the same version of Access on both your desktop and your laptop?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
yes!
but i tell you something on my desktop if i run the statment on access it work but through the program it not works
|
|
|
|
|
Then I have no further suggestions.
But if you post the problem code, someone else may be able to help.
Only post the relevant code, and please surround it with PRE tags, as that keeps the formatting and colourization making it much easier for people to read.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
thanks alot for your time
|
|
|
|
|
Check your connection string. I guess the path to the MDB file must have changed.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
It sounds like you have a broken reference.
In a code window (CTRL+G to bring up the debug window is the easiest way to get to one), go to tools references.
One of the checked items in the list might say broken, if so thats your problem.
If none say broken, then take a screenshot and save it.
Untick all the items that access allows (some it wont allow you to), close the reference dialog and reopen it.
Then find all the items you unticked (the list is sorted alphabetically) and tick them.
Close the dialog and try again!
If you have a missing reference, and can't find it in the list, you'll need to determin where it came from and install it on the desktop.
|
|
|
|
|
Hi,
I am a novice in c# but i have been tinkering windows for long time. What are the libraries which could manipulate pdf files. My requirement is i want to extract images from pdf also i want create image of individual pdf pages... the first one is the most needed... if i could get links or references or explanations that could be nice... meanwhile i will explore codeproject to see some articles related to my requirement...
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
As far as libraries go Google for c# pdf libraries and take your pick. There are lots of established ones like PDFSharp, ITextSharp etc. but that search listed several that I have no experience of.
Images of a PDF page? Same thing applies, Google for c# image of pdf page, and it's "eany meany miney mo". The first on the list I got was Generate Thumbnail Images from PDF Documents[^], which although it is VB and gives thumbnails, should suggest a few things. If you don't like that one, pick another, there are loads of hits after all.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I have two dictionaries that I output to two separate DataGridViews. I need to be able to alternate the output of the two dictionaries to one DataGridView. Any help would be appreciated.
|
|
|
|
|
Then just do so by writing some code.
The two dictionaries better have the same number of entries, otherwise you'd have to come up with a more precise specification.
BTW: Right now I can't imagine an application domain where your requirement makes sense.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
I am differencing two files. Each file's specs are put into a dictionary and then output the two files into two separate DataGridViews. Then differences are colored. I am required to show these in a single DataGridView where one line of the gridview is outputted from one dictionary and then the other dictionary is outputted as they alternate. The dictionaries can have different amout of entries as one file may have more or less records than the other.
|
|
|
|