integer - System Overflow Int16 Error in C# on German PCs -


i having bit of issue here. have snippet below of application has been working fine on pc's throughout world of usa, uk, south africa, , australia. however, on 2 german colleagues machines, following code fails error of:

system.overflowexception: value either large or small int16.

this happening @ convert.toint16 steps. wondering if can caused decimal system in germany being comma's opposed periods? also, fielditemsvalues value example is:

[inputtext_confirmname,0,2,49.5216,726.6744,303.2712,47.9664,false,0,0,false,0]

all strings

string[] widgetproperties = fielditemvalues[0].split('_'); string widgettype = widgetproperties[0]; string widgetid = widgetproperties[1]; console.writeline("type: " + widgettype + " id: " + widgetid);  float widgetleft = convert.tosingle(fielditemvalues[3]); float widgettop = convert.tosingle(fielditemvalues[4]); float widgetwidth = convert.tosingle(fielditemvalues[5]); float widgetheight = convert.tosingle(fielditemvalues[6]);  int widgetleftpx = convert.toint16(widgetleft * 2.0); int widgettoppx = convert.toint16(widgettop * 2.0); int widgetwidthpx = convert.toint16(widgetwidth * 2.0); int widgetheightpx = convert.toint16(widgetheight * 2.0); 

i guess here's problem: 726.6744

in german notation, "." thousands separator, not comma - have add locale. english 726.6744 becomes 7,266,744.00


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -