|
|
Home » U++ TheIDE » U++ TheIDE: Packages » atof trucates real number with a dot but not comma on Linux
atof trucates real number with a dot but not comma on Linux [message #13528] |
Sun, 13 January 2008 11:21  |
cocob
Messages: 156 Registered: January 2008
|
Experienced Member |
|
|
Hello all,
I'm a new user of ultimate++ on Linux
I have a really blocking problem with stdlib ascii/float conversion
double val = atof(real.c_str());
when real contains "54.67" for example, the val is truncated to 54.
This source was working with an other IDE
What's the problem ?
Thanks for your help
Edit: Topic name changed by fudadmin
[Updated on: Mon, 14 January 2008 23:49] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: problem with stdlib [message #13562 is a reply to message #13560] |
Mon, 14 January 2008 23:43   |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
I said "something like that"... Have you tried to change the language accordingly to
in Germany, Poland and some ohter countries 'decimal character' is comma, not a dot.
with
SetLanguage(LNG_?????); //language which supports dot
SetDefaultCharset(CHARSET_????); //charset which you get with
a right click in the ide
Which country are you in? Or what language settings have you got in rc.conf (or similar)? (and/or What distro?)
Edit: Actually, yes, LNG_ENGLISH should support dot...
I don't have my Linux hdd at the moment, so can't test.
[Updated on: Tue, 15 January 2008 00:32] Report message to a moderator
|
|
|
Re: problem with stdlib [message #13565 is a reply to message #13562] |
Tue, 15 January 2008 00:09   |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
from http://en.wikipedia.org/wiki/Decimal_separator
dot countries:
Quote: | Countries where a dot is used to mark the radix point include:
Australia, Brunei, Botswana, Canada (English-speaking), Hong Kong, India, Ireland, Israel, Japan, Korea (both North and South), Malaysia, Mexico, New Zealand, Nigeria, Pakistan, People's Republic of China, Peru, Philippines, Singapore, Sri Lanka, Switzerland, Taiwan, Thailand, United Kingdom, United States (including insular areas), Zimbabwe.
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sun Apr 27 22:07:50 CEST 2025
Total time taken to generate the page: 0.03445 seconds
|
|
|