|
Float type has bigger range than Decimal?
regards,
George
|
|
|
|
|
George_George wrote: Float type has bigger range than Decimal?
Yes.
Single (float) has a range of -3.402823e38 to +3.402823e38.
Decimal has a range of -79,228,162,514,264,337,593,543,950,335 to +79,228,162,514,264,337,593,543,950,335.
So, the value 8e29 can be stored in a float but not in a Decimal.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks Guffa!
Question answered.
regards,
George
|
|
|
|
|
|
Hi Eslam,
From the link, it is not mentioned explicitly Nan can not be converted to Decimal. If I missed anything, could you point out please?
regards,
George
|
|
|
|
|
Can't you just try it out for yourself?
float f = float.NaN;
Decimal d = Convert.ToDecimal(f);
yields a OverflowException
modified 12-Sep-18 21:01pm.
|
|
|
|
|
My mistake, Greeeg! Float has less precision, but broader range.
regards,
George
|
|
|
|
|
How would you represent INF or NaN as a Decimal? And as leppie said, floating point types cover a wider range than Decimal.
Double.MaxValue = 1.79769313486232E+308
Single.MaxValue = 3.402823E+38
Decimal.MaxValue = 79228162514264337593543950335
Eslam Afifi
|
|
|
|
|
My mistake, Eslam! Float has less precision, but broader range.
regards,
George
|
|
|
|
|
Eslam Afifi
|
|
|
|
|
Thanks Eslam,
Question answered.
regards,
George
|
|
|
|
|
I am trying to get the owner/parent form of my CollectionEditor. I have tried looking in:
CreateCollectionForm()
And checking the return values properties such as Owner/Parent, but they are set to null.
Does anyone know how to do this?, and if its not possible via the CollectionEditor, how would i do this via P/Invoke as i am guessing this would be possible...
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Hello,
I want to interact with the website which is having Java Applet using C#.net or VB or VBA. That is send the command to Java Applet Application and after that copy the data from Java Applet Application.
Please suggest me about it.
Thanks in Advance,
Vanitha
|
|
|
|
|
Check out my article. hope this is you want.
JAVA.NET [^]
|
|
|
|
|
hi!
there is a path of log files present in system, lets say "E\Perl Logs\EDD\ex080318.log".
there will be two user entry by the user "Month" and "Year" , lets say "02" and"08".
I must get all the log files present by this date. log file present itself been names as 02 and 08 as i have shown in the path above.
Wht i have done, i have stored this path in a variable by the name "filename" .Right now i am getting all the files present in the folder.
any logic tht can be helpful to carry out this work
thnx
Shriya
|
|
|
|
|
|
Thnx for reply, but i wanted little more explanation, if u culd. coz i have taken out the files. wht culd be the best logic so that i can take out the files based on two parameters that is month and year. as of now i m getting all files. i m not geeting , from where to start
"2" and "8" respectively
|
|
|
|
|
You could use a regular expression to extract the year, month and day of the logfile using this regex:
[^\d]+(?<year>\d\d)(?<month>\d\d)(?<day>\d\d)\.log
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
Hi all,
I am developing some custom windows controls and I want every control to be resized when used on the windows form. For example if there is a text box the user can extend the length by just extendeing the legnth of the control. I cannot do this succesfully at then moment I have tried to set AutoSize to true and the AutoSizeMode to GrowAndShrink but it doesn't work.
Do you have any examples?
Thanks in Advance
Tony
Here is my code for the control
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace UserControls.UIControls
{
public partial class LabelledText : UserControl
{
public delegate void EventHandler(Object sender, EventArgs e);
public event EventHandler onGetFocus;
public event EventHandler onLostFocus;
public LabelledText()
{
InitializeComponent();
}
public string LabelText
{
get
{
return lbl.Text;
}
set
{
lbl.Text = value;
}
}
public ContentAlignment LabelAlign
{
get
{
return lbl.TextAlign;
}
set
{
lbl.TextAlign = value;
}
}
public string TextBoxText
{
get
{
return txt.Text;
}
set
{
txt.Text = value;
}
}
public HorizontalAlignment TextBoxAlign
{
get
{
return txt.TextAlign;
}
set
{
txt.TextAlign = value;
}
}
private void LabelledText_Load(object sender, EventArgs e)
{
txt.BackColor = System.Drawing.SystemColors.Control;
}
private void txt_Leave(object sender, EventArgs e)
{
txt.BackColor = System.Drawing.SystemColors.Control;
}
private void txt_Enter(object sender, EventArgs e)
{
txt.BackColor = System.Drawing.Color.White;
}
}
}
|
|
|
|
|
Hi Tony,
Just Use Following Code in you Control.
private void UserControl1_Load(object sender, EventArgs e)<br />
{<br />
textBox1.Width = this.Width;<br />
}<br />
<br />
<br />
private void UserControl1_Resize(object sender, EventArgs e)<br />
{<br />
textBox1.Width = this.Width; <br />
}
Note : Change Control Name According to your control
Let me know when done !!!
Thanks
|
|
|
|
|
Thanks Abhijit that works fine.
However I have a label on the left of the textbox which I want the user to extend it. Also I want the label to get extended automatically when typing long text into it. For example if the text on the label is long like 'International Accounts:' the label should be extended to the size of the text in order to display the whole text.
Thanks in advance
Tony
|
|
|
|
|
Set the anchors for the text box.
|
|
|
|
|
How do I set the anchors for the textbox?
Sorry I am new to it
Thanks
Tony
|
|
|
|
|
In the designer if you select the text box and look in the properties grid there is one called Anchor in the Layout section. You can set which sides to anchor and when the form is resized the control will try to stay the same distance from the edge. However, I don't think a TextBox will stretch up and down unless you have Multiline set to true.
|
|
|
|