c# - Different representations of a decimal point -


i'm seeing difference in behavior between emulator in visual studio , lumia 820 when trying parse double. if have string represent string stringdouble = 3.434233, emulator correctly parses corresponding double value, on lumia 820 in debug mode, have replace dot comma work. causing difference?

that culture problem.

your simulator , phone probably have different cultures set up, that's why have differences in results. use device or invariant culture.

i recommend either use invariant culture everywhere

double.parse("3.5", cultureinfo.invariantculture) 

or current users culture

double number = double.parse("202.667,40", cultureinfo.currentculture); 

for both parsing , translating numbers strings, avoid bugs described


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

python - cx_oracle unable to find Oracle Client -