Languages

Menu
Sites
Language
Parse error when language is set as non english

Hi,

If I execute below code when device language is German or Italian. It gives E_NUM_FORMAT because its expecting string to be L"12,34" as per German number format.

 float dollorvalue = 0.0f;

result r = Float::Parse(L"12.34" ,dollorvalue );
AppLog("%s" , GetErrorMessage );

How can I convert String like L"12.34" into number for languages like German. 

 

Responses

2 Replies
Alex Ashirov

Hi,

It seems that you can only replace required decimal separators manually before pass a string into the Float::Parse(). In order to figure out what symbols you need for the current local you can use Tizen::Locales::NumberSymbols class. Please see link below for more details:
https://developer.tizen.org/help/topic/org.tizen.native.apireference/classTizen_1_1Locales_1_1NumberSymbols.html

Manish Kaushik

Hi Alex,

Thanks for the answer. I was afraid that I will have to do something like this :) .