Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Packages » atof trucates real number with a dot but not comma on Linux
Re: atof trucates real number with a dot but not comma on Linux [message #13660 is a reply to message #13528] Sat, 19 January 2008 15:09 Go to previous messageGo to previous message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Basically you may hack it by changing dots to commas before atof:
#include <Core/Core.h>
using namespace UPP;
CONSOLE_APP_MAIN
{
	String real = "254.6";
	int dotindex;
	while ( (dotindex = real.Find('.')) != -1 ) real.Set(dotindex, ',');
	Cout().Put(real); Cout().PutEol();
}


Still why there's no one competent to resolve locales here is a little mystery to me.
Try to PM luzr about this thread, he should know where to look in U++ to either change locale to english, or to at least give you the decimal separator, so the upper piece of code will work in all languages. (wishful thinking)

I basically have all computers around me set to English and I hate any localized software, just because of these little problems which arise over time, so I'm not familiar with proper solution to those things.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: UVS2 usage
Next Topic: vsprintf() doesn't support "%I64u" format in Win32 platform?
Goto Forum:
  


Current Time: Sat Apr 27 22:27:18 CEST 2024

Total time taken to generate the page: 0.04473 seconds