|
Matt T Heffron wrote: You have a method whose signature says it is returning int , but you
are returning a string ! Should result in a compiler-error on the return statement; I did not want to add the code to do the conversion.
I would still recommend using integers, not floats. You cannot pay half a cent AFAIK, and it would eliminate rounding errors
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Matt T Heffron wrote: You have a method whose signature says it is returning int , but you
are returning a string ! Should result in a compiler-error on the return statement; I did not want to add the code to do the conversion.
I would still recommend using integers, not floats. You cannot pay half a cent AFAIK, and it would eliminate rounding errors
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: I would still recommend using integers, not floats. You cannot pay half a cent AFAIK, and it would eliminate rounding errors
Of course, this is exactly what the decimal data type is for!
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
Matt T Heffron wrote: Of course, this is exactly what the decimal data type is for! "Exactly"? To quote MSDN*;
Compared to floating-point types, the decimal type has more precision and a smaller range, which makes it appropriate for financial and monetary calculations. Treating the items as integers in monetary applications prevents a lot of common errors, like wrong boxing/unboxing, rounding errors, wrong conversions and/or picking an inappropriate datatype. If you count whole items, there is no rounding, and cents only come in whole-variants.
*) MSDN agrees, I don't. Show me 0.000783678 cents and I might change my mind
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: Show me 0.000783678 cents and I might change my mind
The last time I filled up my gas tank it was $3.499/gallon (349.9 cents/gallon)
And, consider why 25cents is called "two-bits": Bit (money)[^] ...
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
Matt T Heffron wrote: 349.9 cents/gallon Which means you get a cent discount if you buy ten; does not mean that a tenth of a cent exists.
That is confusing physical objects (stuff) with claims (I will be getting a cent discount).
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
In the US, the 1/10th of a cent unit is still legally defined and used in some contexts.
Mill (currency)[^]
In any case, the point is that accurate financial arithmetic in units of less than a cent is still a requirement in some cases and using only integer cents can still lead to difficulties.
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
Deserves 5 for effort - quiet day over there!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks
|
|
|
|
|
hi as the topic states im using visual studios 2015 rc
it doesnt come with a build in installer
i tried wix it doesnt get recognized from within visual studios
???any help or tips
modified 12-Aug-15 9:26am.
|
|
|
|
|
There are a few free ones that Google will find for you.
|
|
|
|
|
you can use installshield. Or refer following link.https://visualstudiogallery.msdn.microsoft.com/003f3135-bbca-4eb2-951d-88820065a124
|
|
|
|
|
from what i heard installshields expensive ill have a look at the link , thanks
|
|
|
|
|
jamesmc1535 wrote: it doesnt come with a build in compiler It does, but it may lack an installer. There's InstallShield[^], InstallAware[^] (former WISE), InnoSetup[^] and InstallForge[^], to name a few.
There's a handy comparison on Wikipedia[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
okay but now im a little bit confused , how would i use the inbuilt compiler?
|
|
|
|
|
To compile what? Your code or to build an installer?
|
|
|
|
|
im talking about creating an installer for my program
|
|
|
|
|
Visual Studio doesn't have one built in any more.
|
|
|
|
|
A compiler makes binary from a (text) source file. You invoke it from VS by "running" the application. All the sources will be compiled, and the result executed.
An installer is what you use to get that executable working on another machine, and it would copy both the executable and depending binairies to the target-system.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
thanks see im sorry il edit my question and fix it now , i want an installer
|
|
|
|
|
Unless you want to write one yourself, I suggest you follow the links given and see if any of those installers would be appropriate for your application
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
How to Display the Image in Form2 and the Image selected in listbox of Form1 ?
EXample:
Form1 have listbox(15 images).
Form2 - Display the image in form2.when i click show button in form1
|
|
|
|
|
|
Hello
You need to follow these steps:
Create an Instance of form2 on form1 button click event
Form2 frm = new Form2();
frm.BackgroundImage = Image.FromFile(ListBox1.SelectedItem.ToString());
In that code i assumed that path of images are listed in listbox
Thanks
-------
web designing in Agra
|
|
|
|
|
Watch who you're replying to. Griff already knows how to do this.
Oh, and your solution locks the image file for the lifetime of the Image object you get back from the call to Image.FromFile .
It's better you use a file stream to load the data into a Bitmap and dispose the stream, avoiding the lock on the image file.
|
|
|
|