text to number
-
Hi, I have a little problem converting a string to a number. Situation: string : "1.555,23" thousand seperator = "." decimal seperator = "," Why doesn't this help?
lconv* pConv = localeconv(); pConv->decimal_point = ","; pConv->thousands_sep = ".";
Using the default "C-locale", things get messed up. How can I make sure it uses the (above) seperators so i get correct conversion? Best regards, Jens -
Hi, I have a little problem converting a string to a number. Situation: string : "1.555,23" thousand seperator = "." decimal seperator = "," Why doesn't this help?
lconv* pConv = localeconv(); pConv->decimal_point = ","; pConv->thousands_sep = ".";
Using the default "C-locale", things get messed up. How can I make sure it uses the (above) seperators so i get correct conversion? Best regards, JensJensB wrote:
I have a little problem converting a string to a number.
Use
atoi()
oratof()
. Uselocaleconv()
to get information about the locale settings. Usesetlocale()
to set, change, or query some or all of the current program locale information. So are you trying to get or set information? Why aren't you usingGetLocaleInfo()
andSetLocaleInfo()
?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb