언어 설정

Menu
Sites
Language
Tizen::Locations::Coordinates::Parse
​Hi there,

I've got a problem parsing a String to a Double coordinate.

I'm using Tizen::Locations::Coordinates::Parse.

The Input String looks like this "123:12.123".

But I get:

ERROR / Tizen::Base ( 8880 : 8880 ) : static result Tizen::Base::Double::Parse(const Tizen::Base::String&, double&)(156) > [E_NUM_FORMAT] Double parse failed with reason (E_SUCCESS). Scan stopped at (.123)
ERROR / Tizen::Locations ( 8880 : 8880 ) : static result Tizen::Locations::Coordinates::Parse(const Tizen::Base::String&, double&)(327) > [E_INVALID_ARG] Failed to decode the minute part.

So my question is...what am I doing wrong? :-)

Thanks for any hints.

- Cat

Edited by: Brock Boland on 17 3월, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

8 댓글
Keans
I found it. It is an mistake in the API documentation. Regarding to the documentation, the format should look like this "DD:MM.mm" or this "DD:MM:SS.ss". See here: https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.native.apireference%2FclassTizen_1_1Locations_1_1LocationProvider.html E.g. 123:12.123 won't work. But 123:12,123 works! You see the difference? The comma instead of a point. So thanks Samsung for a faulty documentation....again...
Strange... coord.Parse("123:12.123", test); It returns SUCCESS, but If I write like coord.Parse("123:12,123", test), it returns E_INVALID_ARG. Which SDK version are you using? I am using SDK 2.1 (Build ID : 20130416-1439).
Pushpa G
But the first one worked for me I tried as: double d; Tizen::Locations::Coordinates::Parse("123:12.123",d); AppLog("parsed value is %f",d); I got the output as : parsed value is 123.202050
Keans
I used excactly the same code in a new and clean project. My output: 06-19 15:30:11.620 : ERROR / Tizen::Base ( 5115 : 5115 ) : static result Tizen::Base::Double::Parse(const Tizen::Base::String&, double&)(156) > [E_NUM_FORMAT] Double parse failed with reason (E_SUCCESS). Scan stopped at (.123) 06-19 15:30:11.620 : ERROR / Tizen::Locations ( 5115 : 5115 ) : static result Tizen::Locations::Coordinates::Parse(const Tizen::Base::String&, double&)(327) > [E_INVALID_ARG] Failed to decode the minute part. 06-19 15:30:11.620 : INFO / test ( 5115 : 5115 ) : testMainForm::testMainForm()(16) > parsed value is 0,000000
Pushpa G
same , I am using SDK2.1
Keans
Erm?!?!? I'm using v2.1.0 Build 20130416-1439.
Patrick Mortara
Maybe it depends on your localisation Settings wheter you have to use a comma or a dot.
Keans
I switched from Debug Build to Release Build and on the release, it uses a dot...