1

Resolved

Exception when using scale on computer with different culture

description

Hi,
 
There is a small bug on computer using different decimal separator, in the formating dialog boxes, when using a scale which is inferior to 1: an exception rise. I think the problem is in methods Formatting_Load, because you have hard-coded decimal value to fill the Scale combo-box. Such hard coded value are not culture-dependant. I suggest you use something like that to avoid this problem:
cboScale.Items.Add( String.Format( "{0:F1}", 0.1 ) );
cboScale.Items.Add( String.Format( "{0:F2}", 0.01 ) );
cboScale.Items.Add( String.Format( "{0:F3}", 0.001 ) );
cboScale.Items.Add( String.Format( "{0:F4}", 0.0001 ) );
cboScale.Items.Add( String.Format( "{0:F5}", 0.00001 ) );
cboScale.Items.Add( String.Format( "{0:F6}", 0.000001 ) );
cboScale.Items.Add( String.Format( "{0:F7}", 0.0000001 ) );
Perhaps, there is a better way to do that: I'm not very friendly toward culture-related stuff.
 
By the way, this small application is really useful :)

comments

RudolfHenning wrote Dec 14, 2010 at 4:18 AM

Thanks for the suggestion. Will look into it.