graph - Android - Double Value Error only on Real Device -
here fragment of app used show graph using achartengine:
private void addsampledata() { ... decimalformat twodform = new decimalformat("####.##"); for(i=0; i<count; i++){ list[i] = double.valueof(twodform.format(list[i])); mcurrentseries.add(i, list[i]); } ... } when run app on emulator there no problems (with device , api), when run app on real device error this: "inavlid double: 29,32" , if see values stored in list[] "," (29,32 - 34,56 - ...)and not "." (29.32 - 34.56 - ...) on emulator.
why happen? how can do?
thx in advance!
you're having problem because of language of device, force separator coma.
decimalformat twodform = new decimalformat("#.##"); decimalformatsymbols dfs = new decimalformatsymbols(); dfs.setdecimalseparator(','); twodform.setdecimalformatsymbols(dfs);
Comments
Post a Comment